PluginProbe ʕ •ᴥ•ʔ
Smart Custom 404 Error Page / trunk
Smart Custom 404 Error Page vtrunk
trunk 11.4.6 11.4.7 11.4.8
404page / inc / class-404page-deprecated.php
404page / inc Last commit date
admin 1 year ago ppf 1 year ago class-404page-admin.php 1 year ago class-404page-block-editor.php 1 year ago class-404page-classic-editor.php 1 year ago class-404page-deprecated.php 1 year ago class-404page-settings.php 1 year ago class-404page.php 1 year ago index.php 9 years ago
class-404page-deprecated.php
76 lines
1 <?php
2
3 /**
4 * The 404page deprecated class
5 *
6 * to ensure backward compatibility
7 *
8 * @since 11.0.0
9 */
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit; // Exit if accessed directly
13 }
14
15 /**
16 * The deprecated plugin class
17 */
18 if ( !class_exists( 'PP_404Page_Deprecated' ) ) {
19
20 class PP_404Page_Deprecated extends PPF09_SubClass {
21
22 /**
23 * Do Init
24 *
25 * @since 11.0.0
26 * @access public
27 */
28 public function init() {
29
30
31 // since 11.0.0 all settings are stored in a single serialized value
32 // collet all the individual settings from older versions and create the serialized value
33 // plus the user meta data are deleted
34
35 $newkey = str_replace( '-', '_', $this->core()->get_plugin_slug() ) . '_settings';
36
37 if ( false === get_option( $newkey ) ) {
38
39 if ( false !== get_option( '404page_page_id' ) ) {
40
41 $oldkeys = array(
42 '404page_page_id',
43 '404page_hide',
44 '404page_fire_error',
45 '404page_force_error',
46 '404page_no_url_guessing',
47 '404page_http410_if_trashed',
48 '404page_method'
49 );
50
51 $newvals = array();
52
53 foreach ( $oldkeys as $key ) {
54
55 $newvals[ str_replace( '404page_', '', $key ) ] = get_option( $key );
56 delete_option( $key );
57
58 }
59
60 update_option( $newkey, $newvals );
61
62
63 // delete user meta for old admin notices for all users
64 foreach ( array( 'pp-404page-admin-notice-1', 'pp-404page-admin-notice-2', 'pp-404page-update-notice-v8', 'pp-404page-update-notice-v9' ) as $key ) {
65 delete_metadata( 'user', false, $key, false, true );
66 }
67
68 }
69
70 }
71
72 }
73
74 }
75
76 }