| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: Affiliate Simple Assistent (ASA1) |
| 4 |
Plugin URI: http://www.wp-amazon-plugin.com/ |
| 5 |
Description: Lets you easily <strong>embed Amazon products</strong> into your WordPress posts by use of <strong>[asa]ASIN[/asa]</strong> shortcode. Supports the use of custom templates. You can choose from various presentation styles and of course create your own template in a few seconds. |
| 6 |
Requires at least: 5.1 |
| 7 |
Version: 1.9.0 |
| 8 |
Author: Timo Reith |
| 9 |
Author URI: http://www.ifeelweb.de/ |
| 10 |
Requires PHP: 8.1 |
| 11 |
Tested up to: 6.9.0 |
| 12 |
*/ |
| 13 |
|
| 14 |
/* Copyright 2007-2026 Timo Reith (email : support@wp-amazon-plugin.com) |
| 15 |
|
| 16 |
This program is free software; you can redistribute it and/or modify |
| 17 |
it under the terms of the GNU General Public License as published by |
| 18 |
the Free Software Foundation; either version 2 of the License, or |
| 19 |
(at your option) any later version. |
| 20 |
|
| 21 |
This program is distributed in the hope that it will be useful, |
| 22 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 23 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 24 |
GNU General Public License for more details. |
| 25 |
|
| 26 |
You should have received a copy of the GNU General Public License |
| 27 |
along with this program; if not, write to the Free Software |
| 28 |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 29 |
*/ |
| 30 |
if (version_compare(phpversion(), '5.5') === -1) { |
| 31 |
|
| 32 |
$active_plugins = get_option('active_plugins'); |
| 33 |
|
| 34 |
if (in_array('amazonsimpleadmin/amazonsimpleadmin.php', $active_plugins)) { |
| 35 |
|
| 36 |
// foreach loop removes all entries if there are more than one for the same plugin |
| 37 |
// like I discovered in my test database |
| 38 |
// array_splice($active_plugins, array_search('amazonsimpleadmin/amazonsimpleadmin.php', $active_plugins), 1); |
| 39 |
// array_splice only removes one entry which could be not enough in some cases |
| 40 |
$new_plungins = array(); |
| 41 |
foreach($active_plugins as $plugin) { |
| 42 |
if ($plugin != 'amazonsimpleadmin/amazonsimpleadmin.php' && !empty($plugin)) { |
| 43 |
$new_plungins[] = $plugin; |
| 44 |
} |
| 45 |
} |
| 46 |
update_option('active_plugins', $new_plungins); |
| 47 |
} |
| 48 |
|
| 49 |
die('Your PHP Version is not compatible with this Plugin. <a href="plugins.php">back</a>'); |
| 50 |
} |
| 51 |
|
| 52 |
define('ASA_BASE_FILE', __FILE__); |
| 53 |
define('ASA_LIB_DIR', dirname(__FILE__) . '/lib/'); |
| 54 |
|
| 55 |
// Load Amazon Creators API SDK autoloader (PHP 8.1+ only) |
| 56 |
if (version_compare(PHP_VERSION, '8.1.0', '>=')) { |
| 57 |
$creatorsApiAutoloader = ASA_LIB_DIR . 'AsaAmazonCreatorsApi/autoload.php'; |
| 58 |
if (file_exists($creatorsApiAutoloader)) { |
| 59 |
require_once $creatorsApiAutoloader; |
| 60 |
} |
| 61 |
} |
| 62 |
|
| 63 |
include_once(dirname(__FILE__) . '/AsaCore.php'); |