| @@ -70,14 +70,8 @@ | ||
| 70 | 70 | * @var string $key The product ready key. |
| 71 | 71 | */ |
| 72 | 72 | private $key; |
| 73 | 73 | /** |
| 74 | - * Author URL | |
| 75 | - * | |
| 76 | - * @var string $author_url The author url. | |
| 77 | - */ | |
| 78 | - private $author_url; | |
| 79 | - /** | |
| 80 | 74 | * Product store url. |
| 81 | 75 | * |
| 82 | 76 | * @var string $store_url The store url. |
| 83 | 77 | */ |
| @@ -112,18 +106,11 @@ | ||
| 112 | 106 | * @var string $version The product version. |
| 113 | 107 | */ |
| 114 | 108 | private $version; |
| 115 | 109 | /** |
| 116 | - * Holds a map of loaded products objects. | |
| 117 | - * | |
| 118 | - * @var array Array of loaded products. | |
| 119 | - */ | |
| 120 | - private static $cached_products = []; | |
| 121 | - /** | |
| 122 | 110 | * Root api endpoint. |
| 123 | 111 | */ |
| 124 | 112 | const API_URL = 'https://api.themeisle.com/'; |
| 125 | - | |
| 126 | 113 | /** |
| 127 | 114 | * ThemeIsle_SDK_Product constructor. |
| 128 | 115 | * |
| 129 | 116 | * @param string $basefile Product basefile. |
| @@ -140,27 +127,10 @@ | ||
| 140 | 127 | if ( 0 === $install ) { |
| 141 | 128 | $install = time(); |
| 142 | 129 | update_option( $this->get_key() . '_install', time() ); |
| 143 | 130 | } |
| 144 | - $this->install = $install; | |
| 145 | - self::$cached_products[ crc32( $basefile ) ] = $this; | |
| 146 | - } | |
| 131 | + $this->install = $install; | |
| 147 | 132 | |
| 148 | - /** | |
| 149 | - * Return a product. | |
| 150 | - * | |
| 151 | - * @param string $basefile Product basefile. | |
| 152 | - * | |
| 153 | - * @return Product Product Object. | |
| 154 | - */ | |
| 155 | - public static function get( $basefile ) { | |
| 156 | - $key = crc32( $basefile ); | |
| 157 | - if ( isset( self::$cached_products[ $key ] ) ) { | |
| 158 | - return self::$cached_products[ $key ]; | |
| 159 | - } | |
| 160 | - self::$cached_products[ $key ] = new Product( $basefile ); | |
| 161 | - | |
| 162 | - return self::$cached_products[ $key ]; | |
| 163 | 133 | } |
| 164 | 134 | |
| 165 | 135 | /** |
| 166 | 136 | * Setup props from path. |
| @@ -186,9 +156,9 @@ | ||
| 186 | 156 | * @param string $string the String to be normalized for cron handler. |
| 187 | 157 | * |
| 188 | 158 | * @return string $name The normalized string. |
| 189 | 159 | */ |
| 190 | - public static function key_ready_name( $string ) { | |
| 160 | + static function key_ready_name( $string ) { | |
| 191 | 161 | return str_replace( '-', '_', strtolower( trim( $string ) ) ); |
| 192 | 162 | } |
| 193 | 163 | |
| 194 | 164 | /** |
| @@ -352,17 +322,8 @@ | ||
| 352 | 322 | return $name; |
| 353 | 323 | } |
| 354 | 324 | |
| 355 | 325 | /** |
| 356 | - * Return the product version cache key. | |
| 357 | - * | |
| 358 | - * @return string The product version cache key. | |
| 359 | - */ | |
| 360 | - public function get_cache_key() { | |
| 361 | - return $this->get_key() . '_' . preg_replace( '/[^0-9a-zA-Z ]/m', '', $this->get_version() ) . 'versions'; | |
| 362 | - } | |
| 363 | - | |
| 364 | - /** | |
| 365 | 326 | * Getter for product name. |
| 366 | 327 | * |
| 367 | 328 | * @return string The product name. |
| 368 | 329 | */ |
| @@ -411,9 +372,8 @@ | ||
| 411 | 372 | return add_query_arg( |
| 412 | 373 | [ |
| 413 | 374 | 'name' => rawurlencode( $this->get_name() ), |
| 414 | 375 | 'edd_action' => 'view_changelog', |
| 415 | - 'locale' => get_user_locale(), | |
| 416 | 376 | ], |
| 417 | 377 | $this->get_store_url() |
| 418 | 378 | ); |
| 419 | 379 | } |