Changeset 3807302
- Timestamp:
- 11/17/2026 11:59:25 AM (less than one hour ago)
- Location:
- debut-jobs
- Files:
-
- 6 edited
- 1 copied
-
tags/1.3.5 (copied) (copied from debut-jobs/trunk )
-
tags/1.3.5/debut-jobs.php (modified) (2 diffs)
-
tags/1.3.5/inc/class-board.php (modified) (5 diffs)
-
tags/1.3.5/readme.txt (modified) (2 diffs)
-
trunk/debut-jobs.php (modified) (2 diffs)
-
trunk/inc/class-board.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
debut-jobs/tags/1.3.5/debut-jobs.php
r3804819 r3807302 5 5 * Plugin URI: https://debut.studio/products/jobs/ 6 6 * Description: Show your JobAdder jobs on your WordPress site: a job board and careers page with search, filters and apply, kept in sync with JobAdder. 7 * Version: 1.3. 47 * Version: 1.3.5 8 8 * Author: DEBUT Studio 9 9 * Author URI: https://debut.studio/ … … 86 86 } 87 87 // ── Plugin constants ────────────────────────────────────────────────────────── 88 define( 'DEBUT_JOBS_VERSION', '1.3. 4' );88 define( 'DEBUT_JOBS_VERSION', '1.3.5' ); 89 89 define( 'DEBUT_JOBS_FILE', __FILE__ ); 90 90 define( 'DEBUT_JOBS_DIR', plugin_dir_path( __FILE__ ) ); -
debut-jobs/tags/1.3.5/inc/class-board.php
r3799226 r3807302 93 93 94 94 /** 95 * Ask JobAdder for the account's job boards, and how many live ads each 96 * has, and remember them. JobAdder lists every board on the account 97 * (channels like Indeed too) without saying which are website boards, 98 * so the ad counts help the customer spot the right one. 95 * Ask JobAdder for the account's job boards and remember them. JobAdder 96 * lists every board on the account (channels like Indeed too) without 97 * saying which are website boards, so the customer picks by name. 99 98 * 100 99 * @return array|WP_Error As boards(). … … 121 120 if ( $id === '' ) continue; 122 121 $name = trim( (string) ( $item['name'] ?? ( $item['title'] ?? '' ) ) ); 122 // Only the list itself: JobAdder asks that we don't call boards 123 // other than the one the customer chooses. 123 124 $list[ $id ] = [ 124 125 /* translators: %s: JobAdder job board ID */ 125 126 'name' => $name !== '' ? $name : sprintf( __( 'Board %s', 'debut-jobs' ), $id ), 126 'ads' => self::count_ads( $api_base, $id, $token ),127 'ads' => null, 127 128 ]; 128 129 } 129 130 130 // Boards with live ads first.131 131 uasort( $list, function ( $a, $b ) { 132 return (int) ( $b['ads'] ?? -1 ) <=> (int) ( $a['ads'] ?? -1 ) ?:strcasecmp( $a['name'], $b['name'] );132 return strcasecmp( $a['name'], $b['name'] ); 133 133 } ); 134 134 … … 137 137 } 138 138 139 /** Live ads on a board, or null if JobAdder wouldn't say. */140 private static function count_ads( string $api_base, string $id, string $token ): ?int {141 $res = Debut_Jobs_JobAdder_API::get( $api_base . '/jobboards/' . rawurlencode( $id ) . '/ads?limit=1', $token, 1 );142 if ( is_wp_error( $res ) ) return null;143 [ $body ] = $res;144 if ( isset( $body['totalCount'] ) ) return (int) $body['totalCount'];145 return isset( $body['items'] ) && is_array( $body['items'] ) ? count( $body['items'] ) : null;146 }147 139 148 140 /** … … 182 174 if ( $current !== '' && isset( $list[ $current ] ) ) return 'kept'; 183 175 184 // A site from before 1.3.0 on the old shared board : keep it while185 // it still works, so reconnecting doesn't empty thejobs page.186 if ( $current === self::LEGACY_ID && self::legacy_works()) return 'kept';176 // A site from before 1.3.0 on the old shared board keeps it until 177 // someone chooses a board, so reconnecting doesn't empty its jobs page. 178 if ( $current === self::LEGACY_ID ) return 'kept'; 187 179 188 180 if ( count( $list ) === 1 ) { … … 197 189 } 198 190 199 /** Whether the pre-1.3.0 shared board can still be read. */200 private static function legacy_works(): bool {201 $api_base = rtrim( (string) Debut_Jobs_Settings::get( 'api_base', '' ), '/' );202 $token = Debut_Jobs_JobAdder_API::get_access_token();203 if ( $api_base === '' || is_wp_error( $token ) ) return false;204 $res = Debut_Jobs_JobAdder_API::get( $api_base . '/jobboards/' . self::LEGACY_ID . '/ads?limit=1', $token, 1 );205 return ! is_wp_error( $res );206 }207 191 208 192 /** Forget the board when disconnecting. The jobs stay until another board is chosen. */ -
debut-jobs/tags/1.3.5/readme.txt
r3804819 r3807302 5 5 Tested up to: 7.0 6 6 Requires PHP: 7.4 7 Stable tag: 1.3. 47 Stable tag: 1.3.5 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 166 166 == Changelog == 167 167 168 = 1.3.5 = 169 * Changed: reconnecting only asks JobAdder for your list of job boards, and never calls a board you haven't chosen 170 * Changed: real-time sync ignores ad events for your other job boards (JobAdder sends one per board) and duplicate notifications, without calling JobAdder, so each change is handled once 171 168 172 = 1.3.4 = 169 173 * Changed: updated the Freemius SDK to 2.13.5 -
debut-jobs/trunk/debut-jobs.php
r3804819 r3807302 5 5 * Plugin URI: https://debut.studio/products/jobs/ 6 6 * Description: Show your JobAdder jobs on your WordPress site: a job board and careers page with search, filters and apply, kept in sync with JobAdder. 7 * Version: 1.3. 47 * Version: 1.3.5 8 8 * Author: DEBUT Studio 9 9 * Author URI: https://debut.studio/ … … 86 86 } 87 87 // ── Plugin constants ────────────────────────────────────────────────────────── 88 define( 'DEBUT_JOBS_VERSION', '1.3. 4' );88 define( 'DEBUT_JOBS_VERSION', '1.3.5' ); 89 89 define( 'DEBUT_JOBS_FILE', __FILE__ ); 90 90 define( 'DEBUT_JOBS_DIR', plugin_dir_path( __FILE__ ) ); -
debut-jobs/trunk/inc/class-board.php
r3799226 r3807302 93 93 94 94 /** 95 * Ask JobAdder for the account's job boards, and how many live ads each 96 * has, and remember them. JobAdder lists every board on the account 97 * (channels like Indeed too) without saying which are website boards, 98 * so the ad counts help the customer spot the right one. 95 * Ask JobAdder for the account's job boards and remember them. JobAdder 96 * lists every board on the account (channels like Indeed too) without 97 * saying which are website boards, so the customer picks by name. 99 98 * 100 99 * @return array|WP_Error As boards(). … … 121 120 if ( $id === '' ) continue; 122 121 $name = trim( (string) ( $item['name'] ?? ( $item['title'] ?? '' ) ) ); 122 // Only the list itself: JobAdder asks that we don't call boards 123 // other than the one the customer chooses. 123 124 $list[ $id ] = [ 124 125 /* translators: %s: JobAdder job board ID */ 125 126 'name' => $name !== '' ? $name : sprintf( __( 'Board %s', 'debut-jobs' ), $id ), 126 'ads' => self::count_ads( $api_base, $id, $token ),127 'ads' => null, 127 128 ]; 128 129 } 129 130 130 // Boards with live ads first.131 131 uasort( $list, function ( $a, $b ) { 132 return (int) ( $b['ads'] ?? -1 ) <=> (int) ( $a['ads'] ?? -1 ) ?:strcasecmp( $a['name'], $b['name'] );132 return strcasecmp( $a['name'], $b['name'] ); 133 133 } ); 134 134 … … 137 137 } 138 138 139 /** Live ads on a board, or null if JobAdder wouldn't say. */140 private static function count_ads( string $api_base, string $id, string $token ): ?int {141 $res = Debut_Jobs_JobAdder_API::get( $api_base . '/jobboards/' . rawurlencode( $id ) . '/ads?limit=1', $token, 1 );142 if ( is_wp_error( $res ) ) return null;143 [ $body ] = $res;144 if ( isset( $body['totalCount'] ) ) return (int) $body['totalCount'];145 return isset( $body['items'] ) && is_array( $body['items'] ) ? count( $body['items'] ) : null;146 }147 139 148 140 /** … … 182 174 if ( $current !== '' && isset( $list[ $current ] ) ) return 'kept'; 183 175 184 // A site from before 1.3.0 on the old shared board : keep it while185 // it still works, so reconnecting doesn't empty thejobs page.186 if ( $current === self::LEGACY_ID && self::legacy_works()) return 'kept';176 // A site from before 1.3.0 on the old shared board keeps it until 177 // someone chooses a board, so reconnecting doesn't empty its jobs page. 178 if ( $current === self::LEGACY_ID ) return 'kept'; 187 179 188 180 if ( count( $list ) === 1 ) { … … 197 189 } 198 190 199 /** Whether the pre-1.3.0 shared board can still be read. */200 private static function legacy_works(): bool {201 $api_base = rtrim( (string) Debut_Jobs_Settings::get( 'api_base', '' ), '/' );202 $token = Debut_Jobs_JobAdder_API::get_access_token();203 if ( $api_base === '' || is_wp_error( $token ) ) return false;204 $res = Debut_Jobs_JobAdder_API::get( $api_base . '/jobboards/' . self::LEGACY_ID . '/ads?limit=1', $token, 1 );205 return ! is_wp_error( $res );206 }207 191 208 192 /** Forget the board when disconnecting. The jobs stay until another board is chosen. */ -
debut-jobs/trunk/readme.txt
r3804819 r3807302 5 5 Tested up to: 7.0 6 6 Requires PHP: 7.4 7 Stable tag: 1.3. 47 Stable tag: 1.3.5 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 166 166 == Changelog == 167 167 168 = 1.3.5 = 169 * Changed: reconnecting only asks JobAdder for your list of job boards, and never calls a board you haven't chosen 170 * Changed: real-time sync ignores ad events for your other job boards (JobAdder sends one per board) and duplicate notifications, without calling JobAdder, so each change is handled once 171 168 172 = 1.3.4 = 169 173 * Changed: updated the Freemius SDK to 2.13.5
Note:
See TracChangeset
for help on using the changeset viewer.