| @@ -23,10 +23,10 @@ | ||
| 23 | 23 | * Мы решили добавить в это сообщение кнопку для перехода в безопасный режим. |
| 24 | 24 | */ |
| 25 | 25 | add_filter( 'wp_php_error_message', function ( $message ) { |
| 26 | 26 | $safe_mode_url = admin_url( 'edit.php?post_type=' . WINP_SNIPPETS_POST_TYPE . '&wbcr-php-snippets-safe-mode' ); |
| 27 | - $safe_mode_button = '<div style="margin:20px 0;padding:20px; background:#ffe8e8;">' . __( 'If you see this message after saving the snippet to the Woody Code Snippets plugin, please enable safe mode in the Woody plugin. Safe mode will allow you to continue working in the admin panel of your site and change the snippet in which you made a php error.', 'insert_php' ) . '</div>'; | |
| 28 | - $safe_mode_button .= '<a href="' . $safe_mode_url . '" class="button">' . __( 'Enable safe mode in Woody Code Snippets', 'insert_php' ) . '</a>'; | |
| 27 | + $safe_mode_button = '<div style="margin:20px 0;padding:20px; background:#ffe8e8;">' . __( 'If you see this message after saving the snippet to the Woody ad snippets plugin, please enable safe mode in the Woody plugin. Safe mode will allow you to continue working in the admin panel of your site and change the snippet in which you made a php error.', 'insert_php' ) . '</div>'; | |
| 28 | + $safe_mode_button .= '<a href="' . $safe_mode_url . '" class="button">' . __( 'Enable safe mode in Woody ad snippets', 'insert_php' ) . '</a>'; | |
| 29 | 29 | |
| 30 | 30 | return $message . $safe_mode_button; |
| 31 | 31 | } ); |
| 32 | 32 | |
| @@ -43,9 +43,10 @@ | ||
| 43 | 43 | // Register metaboxes |
| 44 | 44 | require_once( WINP_PLUGIN_DIR . '/admin/metaboxes/base-options.php' ); |
| 45 | 45 | WINP_Helper::register_factory_metaboxes( new WINP_BaseOptionsMetaBox( $plugin ), WINP_SNIPPETS_POST_TYPE, $plugin ); |
| 46 | 46 | |
| 47 | - if ( ( defined( 'FACTORY_ADVERTS_DEBUG' ) && FACTORY_ADVERTS_DEBUG ) || ! WINP_Plugin::app()->premium->is_activate() ) { | |
| 47 | + //if ( current_user_can( 'install_plugins' ) && ! is_plugin_active( 'robin-image-optimizer/robin-image-optimizer.php' ) ) { | |
| 48 | + if ( ! WINP_Plugin::app()->premium->is_activate() ) { | |
| 48 | 49 | require_once( WINP_PLUGIN_DIR . '/admin/metaboxes/info.php' ); |
| 49 | 50 | WINP_Helper::register_factory_metaboxes( new WINP_InfoMetaBox( $plugin ), WINP_SNIPPETS_POST_TYPE, $plugin ); |
| 50 | 51 | } |
| 51 | 52 | |
| @@ -59,16 +60,15 @@ | ||
| 59 | 60 | do_action( 'wbcr/inp/boot/metaboxes/revisions', '' ); |
| 60 | 61 | |
| 61 | 62 | // If the user has updated the plugin or activated it for the first time, |
| 62 | 63 | // you need to show the page "What's new?" |
| 63 | - /* | |
| 64 | - if ( ! WINP_Plugin::app()->isNetworkAdmin() ) { | |
| 64 | + if ( ! WINP_Plugin::app()->isNetworkAdmin() ) { | |
| 65 | 65 | $about_page_viewed = WINP_Plugin::app()->request->get( 'wbcr_inp_about_page_viewed', null ); |
| 66 | 66 | if ( is_null( $about_page_viewed ) ) { |
| 67 | - if ( WINP_Helper::is_need_show_about_page() && current_user_can( 'manage_options' ) ) { | |
| 67 | + if ( WINP_Helper::is_need_show_about_page() ) { | |
| 68 | 68 | try { |
| 69 | 69 | $redirect_url = ''; |
| 70 | - if ( class_exists( 'Wbcr_FactoryPages449' ) ) { | |
| 70 | + if ( class_exists( 'Wbcr_FactoryPages419' ) ) { | |
| 71 | 71 | $redirect_url = WINP_Plugin::app()->getPluginPageUrl( 'about', [ 'wbcr_inp_about_page_viewed' => 1 ] ); |
| 72 | 72 | } |
| 73 | 73 | if ( $redirect_url ) { |
| 74 | 74 | wp_safe_redirect( $redirect_url ); |
| @@ -73,9 +73,9 @@ | ||
| 73 | 73 | if ( $redirect_url ) { |
| 74 | 74 | wp_safe_redirect( $redirect_url ); |
| 75 | 75 | die(); |
| 76 | 76 | } |
| 77 | - } catch ( Exception $e ) { | |
| 77 | + } catch( Exception $e ) { | |
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | } else { |
| 81 | 81 | if ( WINP_Helper::is_need_show_about_page() ) { |
| @@ -82,9 +82,8 @@ | ||
| 82 | 82 | delete_option( $plugin->getOptionName( 'what_new_210' ) ); |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | - */ | |
| 87 | 86 | } ); |
| 88 | 87 | |
| 89 | 88 | function wbcr_inp_admin_revisions() { |
| 90 | 89 | $plugin = WINP_Plugin::app(); |
| @@ -149,9 +148,9 @@ | ||
| 149 | 148 | } |
| 150 | 149 | |
| 151 | 150 | // styles for the plugin shorcodes |
| 152 | 151 | $shortcode_icon = WINP_PLUGIN_URL . '/admin/assets/img/shortcode-icon5.png'; |
| 153 | - $shortcode_title = __( 'Woody Code Snippets', 'insert-php' ); | |
| 152 | + $shortcode_title = __( 'Woody ad snippets', 'insert-php' ); | |
| 154 | 153 | |
| 155 | 154 | $result = WINP_Helper::get_shortcode_data( true ); |
| 156 | 155 | $shortcode_snippets_json = json_encode( $result ); |
| 157 | 156 | ?> |
| @@ -161,11 +160,11 @@ | ||
| 161 | 160 | background: url("<?php echo $shortcode_icon ?>") center no-repeat; |
| 162 | 161 | } |
| 163 | 162 | </style> |
| 164 | 163 | <script> |
| 165 | - var wbcr_inp_tinymce_snippets_button_title = '<?php echo $shortcode_title ?>'; | |
| 166 | - var wbcr_inp_post_tinymce_nonce = '<?php echo wp_create_nonce( 'wbcr_inp_tinymce_post_nonce' ) ?>'; | |
| 167 | - var wbcr_inp_shortcode_snippets = <?php echo $shortcode_snippets_json ?>; | |
| 164 | + var wbcr_inp_tinymce_snippets_button_title = '<?php echo $shortcode_title ?>'; | |
| 165 | + var wbcr_inp_post_tinymce_nonce = '<?php echo wp_create_nonce( 'wbcr_inp_tinymce_post_nonce' ) ?>'; | |
| 166 | + var wbcr_inp_shortcode_snippets = <?php echo $shortcode_snippets_json ?>; | |
| 168 | 167 | </script> |
| 169 | 168 | <!-- /end <?php echo WINP_Plugin::app()->getPluginTitle() ?> for tinymce --> |
| 170 | 169 | <?php |
| 171 | 170 | } |
| @@ -176,11 +175,11 @@ | ||
| 176 | 175 | |
| 177 | 176 | /** |
| 178 | 177 | * Deactivate snippet on trashed |
| 179 | 178 | * |
| 179 | + * @since 2.0.6 | |
| 180 | + * | |
| 180 | 181 | * @param $post_id |
| 181 | - * | |
| 182 | - * @since 2.0.6 | |
| 183 | 182 | * |
| 184 | 183 | */ |
| 185 | 184 | function wbcr_inp_trash_post( $post_id ) { |
| 186 | 185 | $post_type = get_post_type( $post_id ); |