| @@ -4,9 +4,9 @@ | ||
| 4 | 4 | * Plugin URI: https://thepatternswp.com |
| 5 | 5 | * Description: A growing library of ready-made block patterns can help you build websites faster in no time. |
| 6 | 6 | * Author: PatternsWP |
| 7 | 7 | * Author URI: https://thepatternswp.com |
| 8 | - * Version: 1.0.10 | |
| 8 | + * Version: 1.0.5 | |
| 9 | 9 | * License: GPL-2.0+ |
| 10 | 10 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 11 | 11 | * Text Domain: patternswp |
| 12 | 12 | * Domain Path: /languages |
| @@ -19,9 +19,9 @@ | ||
| 19 | 19 | |
| 20 | 20 | // Define plugin constants. |
| 21 | 21 | define('PWP_PLUGIN_DIR', plugin_dir_path(__FILE__)); |
| 22 | 22 | define('PWP_PLUGIN_URL', plugin_dir_url(__FILE__)); |
| 23 | -define('PWP_P_VERSION', '1.0.10'); | |
| 23 | +define('PWP_P_VERSION', '1.0.5'); | |
| 24 | 24 | define('PWP_PLUGIN_FILE', __FILE__); |
| 25 | 25 | define('PWP_ABSPATH', dirname(__FILE__) . '/'); |
| 26 | 26 | define('PWP_VERSION', get_file_data(__FILE__, ['Version'])[0]); |
| 27 | 27 | |
| @@ -51,10 +51,9 @@ | ||
| 51 | 51 | $patternswp_api_section = new PatternsWP_API_Section(); |
| 52 | 52 | $localize_data = [ |
| 53 | 53 | 'isLicenseActive' => $is_active, |
| 54 | 54 | 'externalPatterns' => [], |
| 55 | - 'patternCategories' => $patternswp_api_section->get_patternswp_category_type(), | |
| 56 | - 'patternsNonce' => wp_create_nonce('patternswp_nonce'), | |
| 55 | + 'patternCategories' => $patternswp_api_section->get_patternswp_category_type() | |
| 57 | 56 | ]; |
| 58 | 57 | |
| 59 | 58 | wp_localize_script('patternswp-editor-scripts', 'patternsWpData', $localize_data); |
| 60 | 59 | |
| @@ -71,44 +70,17 @@ | ||
| 71 | 70 | return file_exists($asset_path) ? require_once $asset_path : ['dependencies' => [], 'version' => PWP_VERSION]; |
| 72 | 71 | } |
| 73 | 72 | |
| 74 | 73 | // Plugin activation hook. |
| 75 | -register_activation_hook(__FILE__, 'patternswp_schedule_hourly_cron'); | |
| 74 | +register_activation_hook(__FILE__, function() {}); | |
| 76 | 75 | |
| 77 | -function patternswp_schedule_hourly_cron() { | |
| 78 | - if ( !wp_next_scheduled( 'patternswp_hourly_transient_load' ) ) { | |
| 79 | - wp_schedule_event( time(), 'hourly', 'patternswp_hourly_transient_load' ); | |
| 80 | - } | |
| 81 | -} | |
| 82 | - | |
| 83 | 76 | // Plugin deactivation hook. |
| 84 | -register_deactivation_hook(__FILE__, 'patternswp_remove_hourly_cron'); | |
| 77 | +register_deactivation_hook(__FILE__, function() {}); | |
| 85 | 78 | |
| 86 | -function patternswp_remove_hourly_cron() { | |
| 87 | - $timestamp = wp_next_scheduled( 'patternswp_hourly_transient_load' ); | |
| 88 | - if ( $timestamp ) { | |
| 89 | - wp_unschedule_event( $timestamp, 'patternswp_hourly_transient_load' ); | |
| 90 | - } | |
| 91 | -} | |
| 92 | - | |
| 93 | 79 | /** |
| 94 | 80 | * AJAX handler to fetch patterns. |
| 95 | 81 | */ |
| 96 | 82 | function fetch_patterns_handler() { |
| 97 | - | |
| 98 | - // Verify nonce | |
| 99 | - if (!isset($_POST['nonce'])) { | |
| 100 | - wp_send_json_error('Missing nonce'); | |
| 101 | - wp_die(); | |
| 102 | - } | |
| 103 | - | |
| 104 | - $nonce = sanitize_text_field(wp_unslash($_POST['nonce'])); | |
| 105 | - | |
| 106 | - if (!wp_verify_nonce($nonce, 'patternswp_nonce')) { | |
| 107 | - wp_send_json_error('Invalid nonce'); | |
| 108 | - wp_die(); | |
| 109 | - } | |
| 110 | - | |
| 111 | 83 | if (!isset($_POST['page']) || !isset($_POST['patternsPerPage'])) { |
| 112 | 84 | wp_send_json_error('Missing parameters'); |
| 113 | 85 | wp_die(); |
| 114 | 86 | } |
| @@ -170,5 +142,5 @@ | ||
| 170 | 142 | $links[] = '<a href="https://wordpress.org/support/plugin/patternswp/reviews/?filter=5" target="_blank">Rate Us</a>'; |
| 171 | 143 | } |
| 172 | 144 | return $links; |
| 173 | 145 | } |
| 174 | -add_filter('plugin_row_meta', 'patternswp_add_plugin_meta_links', 10, 2); | |
| 146 | +add_filter('plugin_row_meta', 'patternswp_add_plugin_meta_links', 10, 2); | |