'General Tab',
"id" => 'apipp_general_tab',
"tab" => 'general',
"current_tab" => $current_tab,
"type" => "tab-wrapper-start"),
array( "name" => __('Amazon API Settings','amazon-product-in-a-post-plugin'),
"type" => "heading"),
array( "name" => __('Your Amazon Locale/Region','amazon-product-in-a-post-plugin'),
"desc" => __('The Locale to use for Amazon API Calls (ca, cn, com, com.au, com.br, co.uk, de, fr, jp, es, in, it). Default is "com" for US.','amazon-product-in-a-post-plugin')."
",
"id" => "apipp_amazon_locale",
"type" => "select",
"options" => array(
"0" => array("value" => "com","text" => __('US (default)','amazon-product-in-a-post-plugin')),
"12" => array("value" => "com.au","text" => __('Australia','amazon-product-in-a-post-plugin')),
"1" => array("value" => "com.br","text" => __('Brazil','amazon-product-in-a-post-plugin')),
"2" => array("value" => "ca","text" => __('Canada','amazon-product-in-a-post-plugin')),
"3" => array("value" => "cn","text" => __('China','amazon-product-in-a-post-plugin')),
"4" => array("value" => "fr","text" => __('France','amazon-product-in-a-post-plugin')),
"5" => array("value" => "de","text" => __('Germany','amazon-product-in-a-post-plugin')),
"6" => array("value" => "co.jp","text" => __('Japan','amazon-product-in-a-post-plugin')),
"7" => array("value" => "in","text" => __('India','amazon-product-in-a-post-plugin')),
"8" => array("value" => "it","text" => __('Italy','amazon-product-in-a-post-plugin')),
"9" => array("value" => "com.mx","text" => __('Mexico','amazon-product-in-a-post-plugin')),
"10" => array("value" => "es","text" => __('Spain','amazon-product-in-a-post-plugin')),
"11" => array("value" => "co.uk","text" => __('United Kingdom','amazon-product-in-a-post-plugin')),
)),
array( "name" => __('Amazon Affiliate ID','amazon-product-in-a-post-plugin'),
"desc" => __('Your Amazon Affiliate ID','amazon-product-in-a-post-plugin'),'
',
"id" => "apipp_amazon_associateid",
"type" => "text",
"width" => '150'),
array( "name" => __('Amazon Access Key ID','amazon-product-in-a-post-plugin'),
"desc" => __('Your Amazon Access Key ID (or Public Key). If you do not have one, you will need to sign up for one (click a link below):', 'amazon-product-in-a-post-plugin')."
".__('Australia', 'amazon-product-in-a-post-plugin')." (com.au),
".__('Brazil', 'amazon-product-in-a-post-plugin')." (com.br),
".__('Canada', 'amazon-product-in-a-post-plugin')." (ca),
".__('China', 'amazon-product-in-a-post-plugin')." (cn),
".__('France', 'amazon-product-in-a-post-plugin')." (fr),
".__('Germany', 'amazon-product-in-a-post-plugin')." (de),
".__('India', 'amazon-product-in-a-post-plugin')." (in),
".__('Italy', 'amazon-product-in-a-post-plugin')." (it),
".__('Japan', 'amazon-product-in-a-post-plugin')." (jp),
".__('Mexico', 'amazon-product-in-a-post-plugin')." (com.mx),
".__('Spain', 'amazon-product-in-a-post-plugin')." (es),
".__('United Kingdom', 'amazon-product-in-a-post-plugin')." (co.uk),
".__('United States', 'amazon-product-in-a-post-plugin')." (com)
".__('For general information, visit the','amazon-product-in-a-post-plugin')." '".__('Locale Reference for the Product Advertising API','amazon-product-in-a-post-plugin')." ".__('page.','amazon-product-in-a-post-plugin'),
"id" => "apipp_amazon_publickey",
"type" => "text",
"autocomplete" => "off"),
array( "name" => __('Amazon Secret Access Key','amazon-product-in-a-post-plugin'),
"desc" => sprintf(__('Your Amazon Secret Access Key (or Private Key). %1$sCheck out this page%2$s for more information on the Access Key IDs and Secret Access Keys.','amazon-product-in-a-post-plugin'),'','').'
',
"id" => "apipp_amazon_secretkey",
"type" => "password",
"width" => '400',
"autocomplete" => "off"),
array( "name" => __('Test Settings','amazon-product-in-a-post-plugin'),
"desc" => __('Test your API settings to make sure everything is setup correctly. Save your settings before testing.','amazon-product-in-a-post-plugin').'
',
"id" => "apipp_amazon_test_settings",
"button_label" => __('Test API Settings','amazon-product-in-a-post-plugin'),
"class" => 'button button-primary tgm-plugin-update-modal',
"link" => add_query_arg( array( 'action' => 'action_appip_do_test', 'security' => wp_create_nonce( 'appip_ajax_do_settings_test' ),'tab' => 'changelog','width' => 600, 'height' => 500, 'plugin' => 'plugin-name', 'section' => 'changelog', 'TB_iframe' => true ), admin_url( 'admin-ajax.php' ) ),
"wrapper" => "div",
"wrapper_class" => "update-modal-holder",
"type" => "button"),
array( "name" => __('Debug Key','amazon-product-in-a-post-plugin'),
"desc" => sprintf(__('Your Custom Debug Key. This is unique to your site.
If you have problems with the plugin not working and you need help from the developers, email %1$s with this key and your website url or use the notes box below and click the "Developers Only" button. They will be able to use this info it to figure out issues and help resolve them for you. Without it, they can do nothing to help. If you received help and the problem is resolved, you can change this debug key to make sure the developers cannot access the debugging features again, should you feel inclined to do so.
If you would like to send debug info via email (to yourself or the developers), enter your email address below and click "Send Debug Info". If you need help and you want a copy to go to the plugin developers, click the "Copy Developers" button (if you add an email address and want it to be sent to you as well as the developers) or "Send to Developers Only" to just sned to the Developers without copying anyone else. If you send a copy to the Developers, be sure to include a note or we can\'t help you.','amazon-product-in-a-post-plugin'),'amazon-plugin-help@fischercreativemedia.com'),
"id" => "apipp_amazon_debugkey",
"type" => "text"),
/*
array( "name" => __('API get method', 'amazon-product-in-a-post-plugin'),
"desc" => __('If you are seeing BLANK products it may be because your server does not support the php file_get_contents() function. If that is the case, try CURL option to see if it resolves the problem. Default is File Get Contents method.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_API_call_method",
"type" => "select",
"options" => array(
"0" => array("value" => "0","text" => "file_get_contents() (default)"),
"1" => array("value" => "1","text" => "CURL"),
)),
*/
array( "name" => 'General Tab End',
"id" => 'apipp_general_tab_end',
"type" => "tab-wrapper-end",
),
array( "name" => 'Advanced Tab',
"id" => 'apipp_advanced_tab',
"tab" => 'advanced',
"current_tab" => $current_tab,
"type" => "tab-wrapper-start",
),
array( "name" => __('Advanced Settings','amazon-product-in-a-post-plugin'),
"type" => "heading"),
array( "name" => __('Cache Ahead?', 'amazon-product-in-a-post-plugin'),
"desc" => __('Allows plugin to cache products prior to the WordPress loop. If you have products on posts list pages or categories, this may be required to prevent throttling from Amazon due to rapid API requests.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_amazon_cache_ahead",
"type" => "checkbox"),
array( "name" => __('Cache Length','amazon-product-in-a-post-plugin'),
"desc" => __('The product cache length in seconds (i.e., 60 min. = 3600 seconds). Recommend setting less than 24 hours (86400). Default is 3600.','amazon-product-in-a-post-plugin'),'
',
"id" => "apipp_amazon_cache_sec",
"type" => "text",
"width" => '100'),
array( "name" => __('Use Add To Cart URL?', 'amazon-product-in-a-post-plugin'),
"desc" => __('Uses the "Add to Cart" URL instead of product page URL for links. This can help with 90 day Cookie Conversions.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_use_cartURL",
"type" => "checkbox"),
array( "name" => __('Use Amazon Featured Image Functionality?', 'amazon-product-in-a-post-plugin'),
"desc" => __('Adds a meta box section to the Edit Screen to add an Amazon Featured Image URL. Integrates into the WordPress Featured Image functionality.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_product_featured_image",
"type" => "checkbox"),
array( "name" => __('Add Amazon Mobile Popover Functionality?', 'amazon-product-in-a-post-plugin'),
"desc" => ''.__('Disabled until future update.','amazon-product-in-a-post-plugin').' '.__('Check if you would also like to use Mobile Popovers. IMPORTANT! Do not use if you have Amazon OneLink on your site already, as it is not compatible with Mobile Popovers.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_product_mobile_popover",
"type" => "checkbox-disabled"),
array( "name" => __('Hook plugin into Content?', 'amazon-product-in-a-post-plugin'),
"desc" => __('If you want to have the product displayed when the the_content() function is called, select this box. NOTE: This is the standard call that theme\'s use to display the page/post content. If you disable both Excerpt and Content, the only way you can add products to a page/post is to add the shortcode. You can override this on each individual page/post.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_hook_content",
"type" => "checkbox"),
array( "name" => __('Hook plugin into Excerpt?', 'amazon-product-in-a-post-plugin'),
"desc" => __('If you want to have the product displayed when the the_excerpt() function is called, select this box. This is typically used on Post list or archive/category pages. Disable this function if your theme uses short excerpts on pages, such as the home page. You can override this on each individual page/post.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_hook_excerpt",
"type" => "checkbox"),
array( "name" => __('Open Product Link in New Window?', 'amazon-product-in-a-post-plugin'),
"desc" => __('If you want to have the product displayed in a new window, check this box. Default is no.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_open_new_window",
"type" => "checkbox"),
array( "name" => __('Show on Single Page Only?', 'amazon-product-in-a-post-plugin'),
"desc" => __('If you want to have the product displayed only when the page/post is singular, check this box. Default is no.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_show_single_only",
"type" => "checkbox"),
//apipp_amazon_use_lightbox
array( "name" => __('Use Internal Lightbox?', 'amazon-product-in-a-post-plugin'),
"desc" => __('Use the the included Lightbox scripts for "larger image" popup. If you have a lightbox script already, you can turn this off so it will not conflict or show two popups.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_amazon_use_lightbox",
"type" => "checkbox"),
array( "name" => __('Hide Binding in Title?', 'amazon-product-in-a-post-plugin'),
"desc" => __('If selected, the binding will be not shown in the Product Title. i.e., With Binding - Product Title (DVD), Without Binding - Product Title.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_hide_binding",
"type" => "checkbox"),
array( "name" => __('Not Available Error Message', 'amazon-product-in-a-post-plugin'),
"desc" => __('The message to display if the item is not available for some reason, i.e., your locale or no longer available.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_amazon_notavailable_message",
"type" => "textlong"),
array( "name" => __('Amazon Hidden Price Message', 'amazon-product-in-a-post-plugin'),
"desc" => __('For Some products, Amazon will hide the List price of a product. When hidden, this plugin cannot show a price for the product. This message will display in the List Price area when that occurs.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_amazon_hiddenprice_message",
"type" => "textlong"),
array( "name" => __('Quick Fix - Hide Warnings?', 'amazon-product-in-a-post-plugin'),
"desc" => ''.__('IMPORTANT:', 'amazon-product-in-a-post-plugin').' '.__('Checking this box will excecute the code, ini_set("display_errors", 0); to force stop NOTICE and WARNING messages. This can be helpful if your server php configuration has error reporting on and you are getting warning messages. This WILL override any setting you have in your php.ini or php config files. It is not recommended you turn this on unless you need it.', 'amazon-product-in-a-post-plugin') ."
",
"id" => "apipp_hide_warnings_quickfix",
"type" => "checkbox"),
array( "name" => __('Clear data on Deactivate?', 'amazon-product-in-a-post-plugin'),
"desc" => "".__('CAREFUL!!', 'amazon-product-in-a-post-plugin')." ".__('Checking this box will delete ALL settings and database items when you deativate the plugin', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_uninstall",
"type" => "checkbox"),
array( "name" => __('Remove ALL traces on Uninstall?', 'amazon-product-in-a-post-plugin'),
"desc" => "".__('CAREFUL!!', 'amazon-product-in-a-post-plugin')." ".__('Checking this box AND the above box will delete ALL Amazon shortcodes from posts and pages, and all meta data associated with this plugin will be cleaned up and cleared out when you deativate this plugin. As a safety precaution, both boxes must be checked or data will not be removed.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_uninstall_all",
"type" => "checkbox"),
array( "name" => 'Advanced Tab End',
"id" => 'apipp_advanced_tab_end',
"type" => "tab-wrapper-end"),
array( "name" => 'Styles Tab',
"id" => 'apipp_styles_tab',
"tab" => 'styles',
"current_tab" => $current_tab,
"type" => "tab-wrapper-start"),
array( "name" => __('Plugin Styles','amazon-product-in-a-post-plugin'),
"type" => "heading"),
array( "name" => __('Use My Custom Styles?', 'amazon-product-in-a-post-plugin'),
"desc" => __('If you want to use your own styles, check this box and enter them below. Additionally, if you want to override any plugin styles, you can put your own styles in a CSS file called appip-styles.css located at: ', 'amazon-product-in-a-post-plugin').''.get_stylesheet_directory_uri().'/appip-styles.css
or'.get_stylesheet_directory_uri()."/css/appip-styles.css
",
"id" => "apipp_product_styles_mine",
"type" => "checkbox"),
array( "name" => __('Product Styles', 'amazon-product-in-a-post-plugin'),
"desc" => __('Your Custom styles can go here. To reset the styles, remove all styles from textarea and then save the options - the default styles will be loaded.', 'amazon-product-in-a-post-plugin')."
",
"id" => "apipp_product_styles",
"type" => "textareabig"),
array( "name" => 'Styles Tab End',
"id" => 'apipp_styles_tab_end',
"type" => "tab-wrapper-end",
),
);
$options_apipp = apply_filters( 'amazon_product_options_additional_options', $options_apipp, $current_tab );
}
function apipp_options_add_subpage(){
global $fullname_apipp, $shortname_apipp, $options_apipp;
apipp_options_admin_page($fullname_apipp, 'apipp', $options_apipp);
}
function apipp_options_add_admin_page($themename,$shortname,$options) {
$up_opt='';
if ( basename(__FILE__) == 'amazon-product-in-a-post-options.php' ) {
if(isset($_REQUEST['action'])){
$req_action = esc_attr( $_REQUEST['action'] );
}else{
$req_action = '';
}
if( isset($_REQUEST[$shortname.'_option']) ){
$req_option = esc_attr( $_REQUEST[$shortname.'_option'] );
}else{
$req_option = '';
}
if ( 'save' == $req_action && $req_option == $shortname ) {
check_ajax_referer( 'appip_options_nonce_ji9osdjfkjl', 'appip_nonce', true );
foreach ($options as $value) {
if(isset($value['type']) && $value['type'] == 'multicheck'){
if(isset($value['options']) && !empty($value['options'])){
foreach($value['options'] as $mc_key => $mc_value){
$up_opt = $value['id'].'_'.$mc_key;
if( isset( $_REQUEST[ $up_opt ] ) ) {
update_option( $up_opt, ($_REQUEST[ $up_opt ]) );
$update_optionapp = ($_REQUEST[ $up_opt ]);
} else {
delete_option( $up_opt );
$update_optionapp='';
}
}
}
}elseif(isset($value['type']) && $value['type'] == 'select'){
foreach( $value['options'] as $mc_key => $mc_value ){
$up_opt = $value['id'];
if( isset( $_REQUEST[ $up_opt ] ) && ($_REQUEST[ $up_opt ] == $mc_value['value']) ) {
update_option( $value['id'], $mc_value['value']);
}
}
}else{
if( isset($value['id']) && isset( $_REQUEST[ $value['id'] ] ) ) {
if( $value['id'] == 'apipp_amazon_publickey' || $value['id'] == 'apipp_amazon_secretkey' ){
update_option( $value['id'], trim(($_REQUEST[ $value['id'] ])) );
}else{
update_option( $value['id'], esc_attr(stripslashes($_REQUEST[ $value['id'] ])) );
}
} else {
if(isset($value['id'])){
delete_option( $value['id'] );
}
}
}
}
if(
(isset($_REQUEST['appip_debug_submit']) && $_REQUEST['appip_debug_submit'] != '' )
||
(isset($_REQUEST['appip_debug_submit_all']) && $_REQUEST['appip_debug_submit_all'] != '' )
||
(isset($_REQUEST['appip_debug_submit_dev']) && $_REQUEST['appip_debug_submit_dev'] != '' )
){
$temp = AmazonDebugInfoClass::generate_server_data(true);
}
amazon_product_delete_all_cache('option-update');
$curtab = isset($_REQUEST['appip_current_tab']) && $_REQUEST['appip_current_tab'] !== '' ? esc_attr($_REQUEST['appip_current_tab']) : 'general';
wp_redirect("admin.php?page=".$shortname."_plugin_admin&saved=true".($curtab != '' ? '&tab='.$curtab : '' ),302);
die;
} else if( 'reset' == $req_action && $req_option == $shortname ) {
check_ajax_referer( 'appip_options_nonce_ji9osdjfkjl', 'appip_nonce', true );
foreach ($options as $value) {
if($value['type'] != 'multicheck'){
delete_option( $value['id'] );
}else{
foreach($value['options'] as $mc_key => $mc_value){
$del_opt = $value['id'].'_'.$mc_key;
delete_option($del_opt);
}
}
}
wp_redirect("admin.php?page=".$shortname."_plugin_admin&reset=true",302);
die;
}
}
}
function apipp_options_admin_page($themename, $shortname, $options) {
//if ( get_option('apipp_product_styles') == ''){ update_option('apipp_product_styles',$thedefaultapippstyle); }
if (isset($_REQUEST['dismissmsg']) && $_REQUEST['dismissmsg'] == '1'){update_option('appip_dismiss_msg',1);echo '
'.$themename.' message dismissed.
'.$themename.' settings saved.
'.$themename.' settings reset.
'.$themename.' Debug Information Sent.
'.__('No Email Address Provided.', 'amazon-product-in-a-post-plugin').'
'.__('Error: ', 'amazon-product-in-a-post-plugin'). $sent.'
'.__('Success! Debug info sent to ').$sent.'
This is a success message.
This is some information.