Changeset 2680188
- Timestamp:
- 02/16/2022 09:10:36 PM (4 years ago)
- Location:
- datacake-core
- Files:
-
- 1 deleted
- 8 edited
- 15 copied
-
tags/1.1.14 (deleted)
-
tags/1.1.15 (copied) (copied from datacake-core/trunk)
-
tags/1.1.15/LICENSE.txt (copied) (copied from datacake-core/trunk/LICENSE.txt)
-
tags/1.1.15/README.md (copied) (copied from datacake-core/trunk/README.md) (1 diff)
-
tags/1.1.15/README.txt (copied) (copied from datacake-core/trunk/README.txt) (1 diff)
-
tags/1.1.15/datacake_core.php (copied) (copied from datacake-core/trunk/datacake_core.php) (3 diffs)
-
tags/1.1.15/index.php (copied) (copied from datacake-core/trunk/index.php)
-
tags/1.1.15/src (copied) (copied from datacake-core/trunk/src)
-
tags/1.1.15/src/Admin/Crud/BaseCrud.php (copied) (copied from datacake-core/trunk/src/Admin/Crud/BaseCrud.php)
-
tags/1.1.15/src/Includes/DatacakeCoreActivator.php (modified) (1 diff)
-
tags/1.1.15/src/Includes/wpms-smtp-disable-ssl-verify.php (copied) (copied from datacake-core/trunk/src/Includes/wpms-smtp-disable-ssl-verify.php)
-
tags/1.1.15/src/Models/IspCity.php (copied) (copied from datacake-core/trunk/src/Models/IspCity.php)
-
tags/1.1.15/src/Pub/DatacakeCorePublic.php (modified) (2 diffs)
-
tags/1.1.15/src/Shortcodes/CityShortcode.php (copied) (copied from datacake-core/trunk/src/Shortcodes/CityShortcode.php)
-
tags/1.1.15/src/Wda/BaseApi.php (copied) (copied from datacake-core/trunk/src/Wda/BaseApi.php) (1 diff)
-
tags/1.1.15/src/bootstrap.php (copied) (copied from datacake-core/trunk/src/bootstrap.php)
-
tags/1.1.15/uninstall.php (copied) (copied from datacake-core/trunk/uninstall.php)
-
tags/1.1.15/vendor (copied) (copied from datacake-core/trunk/vendor)
-
trunk/README.md (modified) (1 diff)
-
trunk/README.txt (modified) (1 diff)
-
trunk/datacake_core.php (modified) (3 diffs)
-
trunk/src/Includes/DatacakeCoreActivator.php (modified) (1 diff)
-
trunk/src/Pub/DatacakeCorePublic.php (modified) (2 diffs)
-
trunk/src/Wda/BaseApi.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
datacake-core/tags/1.1.15/README.md
r2609130 r2680188 15 15 City SEO, this will replicate a text changing the city in the text for SEO purposes 16 16 17 * Version: V1.1.1 417 * Version: V1.1.15 18 18 19 19 -
datacake-core/tags/1.1.15/README.txt
r2609130 r2680188 6 6 Tested up to: 5.7.0 7 7 Requires PHP: 7.2 8 Stable tag: 1.1.1 49 Last Tag: 1.1.1 38 Stable tag: 1.1.15 9 Last Tag: 1.1.14 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
datacake-core/tags/1.1.15/datacake_core.php
r2609130 r2680188 16 16 * Plugin URI: http://www.datacake.com.br 17 17 * Description: Plugin Datacake para linkar com as Funcionalidade do Data ISP/ISP OG - Redirecionar cidade baseada no cookie 18 * Version: 1.1.1 418 * Version: 1.1.15 19 19 * Author: Paulo Peres Jr 20 20 * Author URI: https://github.com/PauloPeres … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'DATACAKE_CORE_VERSION', '1.1.1 4' );38 define( 'DATACAKE_CORE_VERSION', '1.1.15' ); 39 39 40 40 require_once __DIR__ . '/vendor/autoload.php'; … … 49 49 } 50 50 function update_datacake_core() { 51 // Isso parece estranho mas por causa do Wordpress Network pode ser que o register_activation_hook não rode 52 // então temos que checar de qualquer maneira se o Plugin esta ativo 53 DatacakeCoreActivator::activate(); 51 54 DatacakeCoreActivator::update(); 52 55 } -
datacake-core/tags/1.1.15/src/Includes/DatacakeCoreActivator.php
r2481788 r2680188 32 32 public static function activate() { 33 33 global $wpdb; 34 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 35 $charset_collate = $wpdb->get_charset_collate(); 36 if( ! get_option(self::$config_name,null) ) { 37 require_once( 38 realpath(__DIR__.'/../Models/db/001Initial.php') 39 ); 34 $db_version = get_option(self::$config_name, '0.0.0'); 35 if( version_compare( $db_version, '1.0.0', '<' ) ) { 36 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 37 $charset_collate = $wpdb->get_charset_collate(); 38 if( ! get_option(self::$config_name,null) ) { 39 require_once( 40 realpath(__DIR__.'/../Models/db/001Initial.php') 41 ); 42 } 40 43 } 41 44 -
datacake-core/tags/1.1.15/src/Pub/DatacakeCorePublic.php
r2481788 r2680188 159 159 } 160 160 }else{ 161 161 if($page_id){ 162 $data_force_redirect = get_option('datacake_redir_force',null); 163 $data_redirect_id = get_option('datacake_redir_page_id',null); 164 165 if($data_force_redirect && $data_redirect_id){ 166 global $wp; 167 $currentUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; 168 if(strpos($currentUrl, 'wp-admin') !== false || strpos($currentUrl, 'wp-login') !== false){ 169 //Admin or login found in the current url let's not redirect 170 }else{ 171 $redirect = isset($_GET['redirect']) ? $_GET['redirect'] : $currentUrl; 172 $link = get_permalink($data_redirect_id)."?redirect=".$redirect; 173 if($data_redirect_id != $page_id){ 174 header("Location: $link"); 175 die(); 176 } 177 } 178 } 179 } 162 180 } 163 181 } … … 182 200 if($city){ 183 201 $utils->setCity($city->id); 184 }else{185 $city = $utils->getCity();186 if(!$city){187 $data_force_redirect = get_option('datacake_redir_force',null);188 $data_redirect_id = get_option('datacake_redir_page_id',null);189 190 if($data_force_redirect && $data_redirect_id){191 global $wp;192 $currentUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";193 if(strpos($currentUrl, 'wp-admin') !== false || strpos($currentUrl, 'wp-login') !== false){194 //Admin or login found in the current url let's not redirect195 }else{196 $redirect = isset($_GET['redirect']) ? $_GET['redirect'] : $currentUrl;197 $link = get_permalink($data_redirect_id)."?redirect=".$redirect;198 if($currentUrl != $link){199 header("Location: $link");200 die();201 }202 }203 }204 }205 202 } 206 203 } -
datacake-core/tags/1.1.15/src/Wda/BaseApi.php
r2609130 r2680188 26 26 27 27 $this->config = get_option('datacake_api'); 28 29 // Instantiate an empty PSR-7 request, note that the default HTTP method must be provided 30 $this->request = new Request('GET', ''); 28 // Instantiate an empty PSR-7 request, note that the default HTTP method must be provided 29 $this->request = new Request('GET', ''); 31 30 32 // Instantiate the request builder 33 $this->requestBuilder = new JsonApiRequestBuilder($this->request); 34 $this->requestBuilder 35 ->setProtocolVersion("1.1") 36 ->setMethod("GET") 37 ->setUri($this->config['url'].$this->version.$this->baseUrl) 38 ->setHeader("Accept-Charset", "utf-8"); 31 // Instantiate the request builder 32 $this->requestBuilder = new JsonApiRequestBuilder($this->request); 33 if($this->config){ 34 $this->requestBuilder 35 ->setProtocolVersion("1.1") 36 ->setMethod("GET") 37 ->setUri($this->config['url'].$this->version.$this->baseUrl) 38 ->setHeader("Accept-Charset", "utf-8"); 39 } 39 40 } 40 41 -
datacake-core/trunk/README.md
r2609130 r2680188 15 15 City SEO, this will replicate a text changing the city in the text for SEO purposes 16 16 17 * Version: V1.1.1 417 * Version: V1.1.15 18 18 19 19 -
datacake-core/trunk/README.txt
r2609130 r2680188 6 6 Tested up to: 5.7.0 7 7 Requires PHP: 7.2 8 Stable tag: 1.1.1 49 Last Tag: 1.1.1 38 Stable tag: 1.1.15 9 Last Tag: 1.1.14 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
datacake-core/trunk/datacake_core.php
r2609130 r2680188 16 16 * Plugin URI: http://www.datacake.com.br 17 17 * Description: Plugin Datacake para linkar com as Funcionalidade do Data ISP/ISP OG - Redirecionar cidade baseada no cookie 18 * Version: 1.1.1 418 * Version: 1.1.15 19 19 * Author: Paulo Peres Jr 20 20 * Author URI: https://github.com/PauloPeres … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'DATACAKE_CORE_VERSION', '1.1.1 4' );38 define( 'DATACAKE_CORE_VERSION', '1.1.15' ); 39 39 40 40 require_once __DIR__ . '/vendor/autoload.php'; … … 49 49 } 50 50 function update_datacake_core() { 51 // Isso parece estranho mas por causa do Wordpress Network pode ser que o register_activation_hook não rode 52 // então temos que checar de qualquer maneira se o Plugin esta ativo 53 DatacakeCoreActivator::activate(); 51 54 DatacakeCoreActivator::update(); 52 55 } -
datacake-core/trunk/src/Includes/DatacakeCoreActivator.php
r2481788 r2680188 32 32 public static function activate() { 33 33 global $wpdb; 34 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 35 $charset_collate = $wpdb->get_charset_collate(); 36 if( ! get_option(self::$config_name,null) ) { 37 require_once( 38 realpath(__DIR__.'/../Models/db/001Initial.php') 39 ); 34 $db_version = get_option(self::$config_name, '0.0.0'); 35 if( version_compare( $db_version, '1.0.0', '<' ) ) { 36 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 37 $charset_collate = $wpdb->get_charset_collate(); 38 if( ! get_option(self::$config_name,null) ) { 39 require_once( 40 realpath(__DIR__.'/../Models/db/001Initial.php') 41 ); 42 } 40 43 } 41 44 -
datacake-core/trunk/src/Pub/DatacakeCorePublic.php
r2481788 r2680188 159 159 } 160 160 }else{ 161 161 if($page_id){ 162 $data_force_redirect = get_option('datacake_redir_force',null); 163 $data_redirect_id = get_option('datacake_redir_page_id',null); 164 165 if($data_force_redirect && $data_redirect_id){ 166 global $wp; 167 $currentUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; 168 if(strpos($currentUrl, 'wp-admin') !== false || strpos($currentUrl, 'wp-login') !== false){ 169 //Admin or login found in the current url let's not redirect 170 }else{ 171 $redirect = isset($_GET['redirect']) ? $_GET['redirect'] : $currentUrl; 172 $link = get_permalink($data_redirect_id)."?redirect=".$redirect; 173 if($data_redirect_id != $page_id){ 174 header("Location: $link"); 175 die(); 176 } 177 } 178 } 179 } 162 180 } 163 181 } … … 182 200 if($city){ 183 201 $utils->setCity($city->id); 184 }else{185 $city = $utils->getCity();186 if(!$city){187 $data_force_redirect = get_option('datacake_redir_force',null);188 $data_redirect_id = get_option('datacake_redir_page_id',null);189 190 if($data_force_redirect && $data_redirect_id){191 global $wp;192 $currentUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";193 if(strpos($currentUrl, 'wp-admin') !== false || strpos($currentUrl, 'wp-login') !== false){194 //Admin or login found in the current url let's not redirect195 }else{196 $redirect = isset($_GET['redirect']) ? $_GET['redirect'] : $currentUrl;197 $link = get_permalink($data_redirect_id)."?redirect=".$redirect;198 if($currentUrl != $link){199 header("Location: $link");200 die();201 }202 }203 }204 }205 202 } 206 203 } -
datacake-core/trunk/src/Wda/BaseApi.php
r2609130 r2680188 26 26 27 27 $this->config = get_option('datacake_api'); 28 29 // Instantiate an empty PSR-7 request, note that the default HTTP method must be provided 30 $this->request = new Request('GET', ''); 28 // Instantiate an empty PSR-7 request, note that the default HTTP method must be provided 29 $this->request = new Request('GET', ''); 31 30 32 // Instantiate the request builder 33 $this->requestBuilder = new JsonApiRequestBuilder($this->request); 34 $this->requestBuilder 35 ->setProtocolVersion("1.1") 36 ->setMethod("GET") 37 ->setUri($this->config['url'].$this->version.$this->baseUrl) 38 ->setHeader("Accept-Charset", "utf-8"); 31 // Instantiate the request builder 32 $this->requestBuilder = new JsonApiRequestBuilder($this->request); 33 if($this->config){ 34 $this->requestBuilder 35 ->setProtocolVersion("1.1") 36 ->setMethod("GET") 37 ->setUri($this->config['url'].$this->version.$this->baseUrl) 38 ->setHeader("Accept-Charset", "utf-8"); 39 } 39 40 } 40 41
Note: See TracChangeset
for help on using the changeset viewer.