PluginProbe
Boxzilla – WordPress Popup Builder / 3.2.4
Boxzilla – WordPress Popup Builder v3.2.4
3.4.11 3.4.10 3.4.9 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 trunk 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 All 72 releases
← All changes | src/licensing/class-license.php +14 -10 3.1.133.2.4 View file →
@@ -76,9 +76,13 @@
76 76 /**
77 77 * Load the license data from the database
78 78 */
79 79 protected function load() {
80 - static $defaults = array(
80 + if( $this->loaded ) {
81 + return;
82 + }
83 +
84 + $defaults = array(
81 85 'key' => '',
82 86 'activation_key' => '',
83 87 'activated' => false,
84 88 'expires_at' => ''
@@ -83,13 +87,11 @@
83 87 'activated' => false,
84 88 'expires_at' => ''
85 89 );
86 90
87 - if( ! $this->loaded ) {
88 - $data = (array) get_option( $this->option_key, array() );
89 - $this->data = array_replace( $defaults, $data );
90 - $this->loaded = true;
91 - }
91 + $data = (array) get_option( $this->option_key, array() );
92 + $this->data = array_replace( $defaults, $data );
93 + $this->loaded = true;
92 94 }
93 95
94 96 /**
95 97 * Reload the license data from DB
@@ -104,11 +106,13 @@
104 106 *
105 107 * @return License
106 108 */
107 109 public function save() {
108 - if( $this->dirty ) {
109 - update_option( $this->option_key, $this->data );
110 - $this->dirty = false;
110 + if( ! $this->dirty ) {
111 + return;
111 112 }
113 +
114 + update_option( $this->option_key, $this->data );
115 + $this->dirty = false;
112 116 }
113 117
114 -}
118 +}