| @@ -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 | */ |
| @@ -111,18 +105,8 @@ | ||
| 111 | 105 | * |
| 112 | 106 | * @var string $version The product version. |
| 113 | 107 | */ |
| 114 | 108 | private $version; |
| 115 | - /** | |
| 116 | - * Holds a map of loaded products objects. | |
| 117 | - * | |
| 118 | - * @var array Array of loaded products. | |
| 119 | - */ | |
| 120 | - private static $cached_products = []; | |
| 121 | - /** | |
| 122 | - * Root api endpoint. | |
| 123 | - */ | |
| 124 | - const API_URL = 'https://api.themeisle.com/'; | |
| 125 | 109 | |
| 126 | 110 | /** |
| 127 | 111 | * ThemeIsle_SDK_Product constructor. |
| 128 | 112 | * |
| @@ -140,27 +124,10 @@ | ||
| 140 | 124 | if ( 0 === $install ) { |
| 141 | 125 | $install = time(); |
| 142 | 126 | update_option( $this->get_key() . '_install', time() ); |
| 143 | 127 | } |
| 144 | - $this->install = $install; | |
| 145 | - self::$cached_products[ crc32( $basefile ) ] = $this; | |
| 146 | - } | |
| 128 | + $this->install = $install; | |
| 147 | 129 | |
| 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 | 130 | } |
| 164 | 131 | |
| 165 | 132 | /** |
| 166 | 133 | * Setup props from path. |
| @@ -186,9 +153,9 @@ | ||
| 186 | 153 | * @param string $string the String to be normalized for cron handler. |
| 187 | 154 | * |
| 188 | 155 | * @return string $name The normalized string. |
| 189 | 156 | */ |
| 190 | - public static function key_ready_name( $string ) { | |
| 157 | + static function key_ready_name( $string ) { | |
| 191 | 158 | return str_replace( '-', '_', strtolower( trim( $string ) ) ); |
| 192 | 159 | } |
| 193 | 160 | |
| 194 | 161 | /** |
| @@ -352,17 +319,8 @@ | ||
| 352 | 319 | return $name; |
| 353 | 320 | } |
| 354 | 321 | |
| 355 | 322 | /** |
| 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 | 323 | * Getter for product name. |
| 366 | 324 | * |
| 367 | 325 | * @return string The product name. |
| 368 | 326 | */ |
| @@ -411,9 +369,8 @@ | ||
| 411 | 369 | return add_query_arg( |
| 412 | 370 | [ |
| 413 | 371 | 'name' => rawurlencode( $this->get_name() ), |
| 414 | 372 | 'edd_action' => 'view_changelog', |
| 415 | - 'locale' => get_user_locale(), | |
| 416 | 373 | ], |
| 417 | 374 | $this->get_store_url() |
| 418 | 375 | ); |
| 419 | 376 | } |