Changeset 3296607
- Timestamp:
- 05/19/2025 03:33:56 PM (11 months ago)
- Location:
- shortcode-variables
- Files:
-
- 6 edited
- 1 copied
-
tags/5.0.1 (copied) (copied from shortcode-variables/trunk)
-
tags/5.0.1/includes/marketing.php (modified) (5 diffs)
-
tags/5.0.1/readme.txt (modified) (2 diffs)
-
tags/5.0.1/shortcode-variables.php (modified) (3 diffs)
-
trunk/includes/marketing.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/shortcode-variables.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shortcode-variables/tags/5.0.1/includes/marketing.php
r3295323 r3296607 51 51 return; 52 52 } 53 54 if ( SH_CD_PREMIUM_PLUGIN_LATEST_VERSION === YK_SS_PLUGIN_VERSION ) { 53 54 $latest_version = sh_cd_get_latest_premium_version(); 55 56 if ( true === empty( $latest_version ) ) { 57 return; 58 } 59 60 if ( $latest_version === YK_SS_PLUGIN_VERSION ) { 55 61 return; 56 62 } … … 63 69 $version_dismissed = sh_cd_marketing_prompt_been_dismissed( '_yeken_shortcode_variables_upgrade_premium_has_been_dismissed' ); 64 70 65 if ( false !== empty( $version_dimissed ) && $version_dismissed === SH_CD_PREMIUM_PLUGIN_LATEST_VERSION) {66 return; 67 } 68 69 $dismiss_url = add_query_arg( [ 'dismiss-premium-upgrade' => SH_CD_PREMIUM_PLUGIN_LATEST_VERSION], sh_cd_get_current_url() );71 if ( false !== empty( $version_dimissed ) && $version_dismissed === $latest_version ) { 72 return; 73 } 74 75 $dismiss_url = add_query_arg( [ 'dismiss-premium-upgrade' => $latest_version ], sh_cd_get_current_url() ); 70 76 71 77 printf('<div class="notice notice-warning"> … … 82 88 $dismiss_url, 83 89 __( 'Dismiss', SH_CD_SLUG ), 84 __( 'Update to ', SH_CD_SLUG ) . SH_CD_PREMIUM_PLUGIN_LATEST_VERSION,90 __( 'Update both plugins via plugin screen', SH_CD_SLUG ), 85 91 sh_cd_premium_shortcode_download( true ), 86 92 ); … … 324 330 325 331 /** 326 * Display admin notice for notification from yeken.uk327 */ 328 function sh_cd_get_ marketing_message() {329 330 if ( $cache = get_transient( '_yeken_shortcode_variables_ update1' ) ) {332 * Fetch the latest version of the premium plugin 333 */ 334 function sh_cd_get_latest_premium_version() { 335 336 if ( $cache = get_transient( '_yeken_shortcode_variables_latest_premium_version' ) ) { 331 337 return $cache; 332 338 } 333 339 334 $response = wp_remote_get( SH_CD_YEKEN_UPDATES_URL ); 340 $response = wp_remote_get( SH_CD_YEKEN_PREMIUM_RELEASE_MANIFEST ); 341 $version = NULL; 335 342 336 343 // All ok? … … 342 349 343 350 $body = json_decode( $body, true ); 351 352 $version = ( false === empty( $body[ 'version' ] ) ) ? $body[ 'version' ] : NULL; 344 353 345 set_transient( '_yeken_shortcode_variables_update', $body, HOUR_IN_SECONDS ); 354 set_transient( '_yeken_shortcode_variables_latest_premium_version', $version, DAY_IN_SECONDS ); 355 } 356 } 357 358 return $version; 359 } 360 361 /** 362 * Display admin notice for notification from yeken.uk 363 */ 364 function sh_cd_get_marketing_message() { 365 366 if ( $cache = get_transient( '_yeken_shortcode_variables_update' ) ) { 367 return $cache; 368 } 369 370 $response = wp_remote_get( SH_CD_YEKEN_UPDATES_URL ); 371 372 // All ok? 373 if ( 200 === wp_remote_retrieve_response_code( $response ) ) { 374 375 $body = wp_remote_retrieve_body( $response ); 376 377 if ( false === empty( $body ) ) { 378 $body = json_decode( $body, true ); 379 380 set_transient( '_yeken_shortcode_variables_update', $body, DAY_IN_SECONDS ); 346 381 347 382 return $body; -
shortcode-variables/tags/5.0.1/readme.txt
r3295323 r3296607 4 4 Requires at least: 6.0 5 5 Tested up to: 6.8 6 Stable tag: 5.0 6 Stable tag: 5.0.1 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 78 78 79 79 == Changelog == 80 81 = 5.0.1 = 82 83 * Improvement: Latest version number of Premium plugin is now fetched from the release manifest rather than hardcoded into the plugin. 84 * Improvement: Only reach out to YeKen servers for update notices once a day, rather than hourly. 85 * Bug fix: Corrected issue where each page call would look for update message from Yeken. 80 86 81 87 = 5.0 = -
shortcode-variables/tags/5.0.1/shortcode-variables.php
r3295323 r3296607 35 35 define( 'SH_CD_ABSPATH', plugin_dir_path( __FILE__ ) ); 36 36 define( 'SH_CD_PLUGIN_VERSION', '5.0' ); 37 define( 'SH_CD_PREMIUM_PLUGIN_LATEST_VERSION', '1.0.4' ); // Used to trigger "there is a newer version" message38 37 define( 'SH_CD_PLUGIN_NAME', 'Snippet Shortcodes' ); 39 38 define( 'SH_CD_TABLE', 'SH_CD_SHORTCODES' ); … … 47 46 define( 'SH_CD_GET_PREMIUM_LINK', 'https://snippetshortcodes.yeken.uk/download/' ); 48 47 define( 'SH_CD_YEKEN_UPDATES_URL', 'https://yeken.uk/downloads/_updates/shortcode-variables.json' ); 48 define( 'SH_CD_YEKEN_PREMIUM_RELEASE_MANIFEST', 'https://snippetshortcodes.yeken.uk/wp-content/plugins/snippet-shortcodes-premium/release.json' ); 49 49 50 50 add_action( 'plugins_loaded', function() { … … 67 67 include_once SH_CD_ABSPATH . 'includes/pages/page.import.php'; 68 68 include_once SH_CD_ABSPATH . 'includes/tinymce.php'; 69 70 69 }); -
shortcode-variables/trunk/includes/marketing.php
r3295323 r3296607 51 51 return; 52 52 } 53 54 if ( SH_CD_PREMIUM_PLUGIN_LATEST_VERSION === YK_SS_PLUGIN_VERSION ) { 53 54 $latest_version = sh_cd_get_latest_premium_version(); 55 56 if ( true === empty( $latest_version ) ) { 57 return; 58 } 59 60 if ( $latest_version === YK_SS_PLUGIN_VERSION ) { 55 61 return; 56 62 } … … 63 69 $version_dismissed = sh_cd_marketing_prompt_been_dismissed( '_yeken_shortcode_variables_upgrade_premium_has_been_dismissed' ); 64 70 65 if ( false !== empty( $version_dimissed ) && $version_dismissed === SH_CD_PREMIUM_PLUGIN_LATEST_VERSION) {66 return; 67 } 68 69 $dismiss_url = add_query_arg( [ 'dismiss-premium-upgrade' => SH_CD_PREMIUM_PLUGIN_LATEST_VERSION], sh_cd_get_current_url() );71 if ( false !== empty( $version_dimissed ) && $version_dismissed === $latest_version ) { 72 return; 73 } 74 75 $dismiss_url = add_query_arg( [ 'dismiss-premium-upgrade' => $latest_version ], sh_cd_get_current_url() ); 70 76 71 77 printf('<div class="notice notice-warning"> … … 82 88 $dismiss_url, 83 89 __( 'Dismiss', SH_CD_SLUG ), 84 __( 'Update to ', SH_CD_SLUG ) . SH_CD_PREMIUM_PLUGIN_LATEST_VERSION,90 __( 'Update both plugins via plugin screen', SH_CD_SLUG ), 85 91 sh_cd_premium_shortcode_download( true ), 86 92 ); … … 324 330 325 331 /** 326 * Display admin notice for notification from yeken.uk327 */ 328 function sh_cd_get_ marketing_message() {329 330 if ( $cache = get_transient( '_yeken_shortcode_variables_ update1' ) ) {332 * Fetch the latest version of the premium plugin 333 */ 334 function sh_cd_get_latest_premium_version() { 335 336 if ( $cache = get_transient( '_yeken_shortcode_variables_latest_premium_version' ) ) { 331 337 return $cache; 332 338 } 333 339 334 $response = wp_remote_get( SH_CD_YEKEN_UPDATES_URL ); 340 $response = wp_remote_get( SH_CD_YEKEN_PREMIUM_RELEASE_MANIFEST ); 341 $version = NULL; 335 342 336 343 // All ok? … … 342 349 343 350 $body = json_decode( $body, true ); 351 352 $version = ( false === empty( $body[ 'version' ] ) ) ? $body[ 'version' ] : NULL; 344 353 345 set_transient( '_yeken_shortcode_variables_update', $body, HOUR_IN_SECONDS ); 354 set_transient( '_yeken_shortcode_variables_latest_premium_version', $version, DAY_IN_SECONDS ); 355 } 356 } 357 358 return $version; 359 } 360 361 /** 362 * Display admin notice for notification from yeken.uk 363 */ 364 function sh_cd_get_marketing_message() { 365 366 if ( $cache = get_transient( '_yeken_shortcode_variables_update' ) ) { 367 return $cache; 368 } 369 370 $response = wp_remote_get( SH_CD_YEKEN_UPDATES_URL ); 371 372 // All ok? 373 if ( 200 === wp_remote_retrieve_response_code( $response ) ) { 374 375 $body = wp_remote_retrieve_body( $response ); 376 377 if ( false === empty( $body ) ) { 378 $body = json_decode( $body, true ); 379 380 set_transient( '_yeken_shortcode_variables_update', $body, DAY_IN_SECONDS ); 346 381 347 382 return $body; -
shortcode-variables/trunk/readme.txt
r3295323 r3296607 4 4 Requires at least: 6.0 5 5 Tested up to: 6.8 6 Stable tag: 5.0 6 Stable tag: 5.0.1 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 78 78 79 79 == Changelog == 80 81 = 5.0.1 = 82 83 * Improvement: Latest version number of Premium plugin is now fetched from the release manifest rather than hardcoded into the plugin. 84 * Improvement: Only reach out to YeKen servers for update notices once a day, rather than hourly. 85 * Bug fix: Corrected issue where each page call would look for update message from Yeken. 80 86 81 87 = 5.0 = -
shortcode-variables/trunk/shortcode-variables.php
r3295323 r3296607 35 35 define( 'SH_CD_ABSPATH', plugin_dir_path( __FILE__ ) ); 36 36 define( 'SH_CD_PLUGIN_VERSION', '5.0' ); 37 define( 'SH_CD_PREMIUM_PLUGIN_LATEST_VERSION', '1.0.4' ); // Used to trigger "there is a newer version" message38 37 define( 'SH_CD_PLUGIN_NAME', 'Snippet Shortcodes' ); 39 38 define( 'SH_CD_TABLE', 'SH_CD_SHORTCODES' ); … … 47 46 define( 'SH_CD_GET_PREMIUM_LINK', 'https://snippetshortcodes.yeken.uk/download/' ); 48 47 define( 'SH_CD_YEKEN_UPDATES_URL', 'https://yeken.uk/downloads/_updates/shortcode-variables.json' ); 48 define( 'SH_CD_YEKEN_PREMIUM_RELEASE_MANIFEST', 'https://snippetshortcodes.yeken.uk/wp-content/plugins/snippet-shortcodes-premium/release.json' ); 49 49 50 50 add_action( 'plugins_loaded', function() { … … 67 67 include_once SH_CD_ABSPATH . 'includes/pages/page.import.php'; 68 68 include_once SH_CD_ABSPATH . 'includes/tinymce.php'; 69 70 69 });
Note: See TracChangeset
for help on using the changeset viewer.