PluginProbe
Depicter — Popup & Slider Builder / 1.9.2
Depicter — Popup & Slider Builder v1.9.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
← All changes | app/hooks.php +15 -8 1.3.81.9.2 View file →
@@ -98,23 +98,22 @@
98 98 return $data;
99 99 }
100 100 add_filter( 'wp_update_attachment_metadata', 'depicter_set_svg_meta_data', 10, 2 );
101 101
102 +function depicter_clear_cache() {
103 + \Depicter::cache('document')->clear();
104 +}
105 +
102 106 function depicter_clear_cache_by_cache_enabler() {
103 107 $cacheEnabled = !empty( $_GET['_cache'] ) && $_GET['_cache'] == 'cache-enabler' ? true : false;
104 108 $isClearAction = !empty( $_GET['_action'] ) && ( $_GET['_action'] == 'clear' || $_GET['_action'] == 'clearurl' );
105 109 if ( $cacheEnabled && $isClearAction && !empty( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'cache_enabler_clear_cache_nonce' ) ) {
106 - $documents = \Depicter::documentRepository()->getList();
107 - if ( !empty( $documents ) ) {
108 - foreach( $documents as $document ) {
109 - \Depicter::cache('document')->delete( $document['id'] );
110 - }
111 - }
110 + depicter_clear_cache();
112 111 }
113 112 }
114 113 add_action( 'init', 'depicter_clear_cache_by_cache_enabler' );
114 +add_action( 'post_updated', 'depicter_clear_cache' );
115 115
116 -
117 116 add_filter( 'style_loader_tag', 'depicter_add_preload_to_styles', 10, 2 );
118 117 function depicter_add_preload_to_styles( $html, $handle ){
119 118 if (strpos( $handle, 'depicter--') === 0) {
120 119 $html = str_replace("rel='stylesheet'", 'rel="preload" as="style" onload="this.rel=\'stylesheet\';this.onload=null"', $html);
@@ -138,5 +137,13 @@
138 137 */
139 138 function depicter_check_deleted_imported_media( $attachment_id ) {
140 139 \Depicter::media()->maybeRemoveAttachmentFromDictionary( $attachment_id );
141 140 }
142 -add_action( 'delete_attachment', 'depicter_check_deleted_imported_media');
141 +add_action( 'delete_attachment', 'depicter_check_deleted_imported_media');
142 +
143 +function depicter_check_activation() {
144 + if ( isset( $_GET['depicter_upgraded'] ) || ( isset( $_GET['page'] ) && $_GET['page'] == 'depicter-dashboard' ) || ( isset( $_GET['action'] ) && $_GET['action'] == 'depicter' ) ) {
145 + \Depicter::client()->validateActivation();
146 + }
147 +}
148 +add_action( 'admin_init', 'depicter_check_activation' );
149 +