first commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
/**
|
||||
* Nothing to see here
|
||||
*/
|
||||
?>
|
||||
@@ -0,0 +1,234 @@
|
||||
<?php
|
||||
/**
|
||||
* Change default footer text, asking to review our plugin
|
||||
**/
|
||||
function my_footer_text($default) {
|
||||
return 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">★★★★★</a> rating. Thanks in advance!';
|
||||
}
|
||||
add_filter('admin_footer_text', 'my_footer_text');
|
||||
|
||||
/**
|
||||
* Create notification object
|
||||
*/
|
||||
$notifications_obj = new WooSEA_Get_Admin_Notifications;
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '7', 'false' );
|
||||
|
||||
/**
|
||||
* Create product attribute object
|
||||
**/
|
||||
$attributes_obj = new WooSEA_Attributes;
|
||||
$attribute_dropdown = $attributes_obj->get_product_attributes();
|
||||
|
||||
/**
|
||||
* Update or get project configuration
|
||||
*/
|
||||
if (array_key_exists('project_hash', $_GET)){
|
||||
$project = WooSEA_Update_Project::get_project_data(sanitize_text_field($_GET['project_hash']));
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_GET['channel_hash']));
|
||||
$count_mappings = count($project['attributes']);
|
||||
$manage_project = "yes";
|
||||
} else {
|
||||
$project = WooSEA_Update_Project::update_project($_POST);
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_POST['channel_hash']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine next step in configuration flow
|
||||
**/
|
||||
$step = 4;
|
||||
if($channel_data['taxonomy'] != "none"){
|
||||
$step = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create channel attribute object
|
||||
**/
|
||||
require plugin_dir_path(__FILE__) . '../../classes/channels/class-'.$channel_data['fields'].'.php';
|
||||
$obj = "WooSEA_".$channel_data['fields'];
|
||||
$fields_obj = new $obj;
|
||||
$attributes = $fields_obj->get_channel_attributes();
|
||||
|
||||
/**
|
||||
* Add the Item Group ID attribute for product variations
|
||||
**/
|
||||
if(isset($_POST['product_variations'])){
|
||||
$attributes["Detailed product description"]["Item group ID"]["format"] = "required";
|
||||
$attributes["Detailed product description"]["Item group ID"]["woo_suggest"] = "item_group_id";
|
||||
|
||||
if ((isset($project[fields])) AND ($project[fields] == "google_shopping")){
|
||||
$attributes["Detailed product description"]["Item group ID"]["feed_name"] = "g:item_group_id";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<div class="woo-product-feed-pro-form-style-2">
|
||||
<div class="woo-product-feed-pro-form-style-2-heading">Field mapping</div>
|
||||
|
||||
<div class="<?php _e($notifications_box['message_type']); ?>">
|
||||
<p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
|
||||
</div>
|
||||
|
||||
<form action="" method="post">
|
||||
<table class="woo-product-feed-pro-table" id="woosea-fieldmapping-table" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Type mapping</th>
|
||||
<th>
|
||||
<?php
|
||||
print "$channel_data[name] attributes";
|
||||
?>
|
||||
</th>
|
||||
<th>Prefix</th>
|
||||
<th>Value</th>
|
||||
<th>Suffix</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="woo-product-feed-pro-body">
|
||||
<?php
|
||||
|
||||
if (!isset($count_mappings)){
|
||||
$c = 0;
|
||||
foreach($attributes as $row_key => $row_value){
|
||||
foreach($row_value as $row_k => $row_v){
|
||||
if ($row_v['format'] == "required"){
|
||||
?>
|
||||
<tr>
|
||||
<td><input type="hidden" name="attributes[<?php print "$c";?>][rowCount]" value="<?php print "$c";?>"><input type="checkbox" name="record" class="checkbox-field"></td>
|
||||
<td><i>field mapping</i></td>
|
||||
<td>
|
||||
<select name="attributes[<?php print"$c"; ?>][attribute]" class="select-field">
|
||||
<?php
|
||||
foreach($attributes as $key => $value) {
|
||||
print "<optgroup label='$key'><strong>$key</strong>";
|
||||
foreach($value as $k => $v){
|
||||
if($v['feed_name'] == $row_v['feed_name']){
|
||||
if (array_key_exists('name',$v)){
|
||||
print "<option value='$v[feed_name]' selected>$k ($v[name])</option>";
|
||||
} else {
|
||||
print "<option value='$v[feed_name]' selected>$k</option>";
|
||||
}
|
||||
} else {
|
||||
if (array_key_exists('name',$v)){
|
||||
print "<option value='$v[feed_name]'>$k ($v[name])</option>";
|
||||
} else {
|
||||
print "<option value='$v[feed_name]'>$k</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="attributes[<?php print "$c";?>][prefix]" class="input-field-medium">
|
||||
</td>
|
||||
<td>
|
||||
<select name="attributes[<?php print "$c";?>][mapfrom]" class="select-field">
|
||||
<option></option>
|
||||
<?php
|
||||
foreach($attribute_dropdown as $drop_key => $drop_value){
|
||||
if(array_key_exists("woo_suggest", $row_v) ){
|
||||
if($row_v['woo_suggest'] == $drop_key){
|
||||
print "<option value='$drop_key' selected>$drop_value</option>";
|
||||
} else {
|
||||
print "<option value='$drop_key'>$drop_value</option>";
|
||||
}
|
||||
} else {
|
||||
print "<option value='$drop_key'>$drop_value</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="attributes[<?php print "$c";?>][suffix]" class="input-field-medium">
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$c++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for ($i = 0; $i < $count_mappings; $i++){
|
||||
if(isset($project['attributes'][$i]['prefix'])){
|
||||
$prefix = $project['attributes'][$i]['prefix'];
|
||||
}
|
||||
if(isset($project['attributes'][$i]['suffix'])){
|
||||
$suffix = $project['attributes'][$i]['suffix'];
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><input type="hidden" name="attributes[<?php print "$i";?>][rowCount]" value="<?php print "$i";?>"><input type="checkbox" name="record" class="checkbox-field"></td>
|
||||
<td><i>field mapping</i></td>
|
||||
<td>
|
||||
<select name="attributes[<?php print"$i"; ?>][attribute]" class="select-field">
|
||||
<?php
|
||||
foreach($attributes as $key => $value) {
|
||||
print "<optgroup label='$key'><strong>$key</strong>";
|
||||
foreach($value as $k => $v){
|
||||
if ($project['attributes'][$i]['attribute'] == $v['feed_name']){
|
||||
print "<option value='$v[feed_name]' selected>$k ($v[name])</option>";
|
||||
} else {
|
||||
print "<option value='$v[feed_name]'>$k ($v[name])</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="attributes[<?php print "$i";?>][prefix]" class="input-field-medium" value="<?php print "$prefix";?>">
|
||||
</td>
|
||||
<td>
|
||||
<select name="attributes[<?php print "$i";?>][mapfrom]" class="select-field">
|
||||
<option></option>
|
||||
<?php
|
||||
foreach($attribute_dropdown as $drop_key => $drop_value){
|
||||
if($project['attributes'][$i]['mapfrom'] == $drop_key){
|
||||
print "<option value='$drop_key' selected>$drop_value</option>";
|
||||
} else {
|
||||
print "<option value='$drop_key'>$drop_value</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="attributes[<?php print "$i";?>][suffix]" class="input-field-medium" value="<?php print "$suffix";?>">
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<input type="hidden" id="channel_hash" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
|
||||
<?php
|
||||
if(isset($manage_project)){
|
||||
?>
|
||||
<input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="step" value="100">
|
||||
<input type="button" class="delete-field-mapping" value="- Delete"> <input type="button" class="add-field-mapping" value="+ Add field mapping"> <input type="button" class="add-own-mapping" value="+ Add own mapping"> <input type="submit" value="Save" />
|
||||
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="step" value="<?php print "$step";?>">
|
||||
<input type="button" class="delete-field-mapping" value="- Delete"> <input type="button" class="add-field-mapping" value="+ Add field mapping"> <input type="button" class="add-own-mapping" value="+ Add own mapping"> <input type="submit" value="Save" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,257 @@
|
||||
<?php
|
||||
/**
|
||||
* Change default footer text, asking to review our plugin
|
||||
**/
|
||||
function my_footer_text($default) {
|
||||
return 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">★★★★★</a> rating. Thanks in advance!';
|
||||
}
|
||||
add_filter('admin_footer_text', 'my_footer_text');
|
||||
|
||||
/**
|
||||
* Create notification object
|
||||
*/
|
||||
$notifications_obj = new WooSEA_Get_Admin_Notifications;
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '7', 'false' );
|
||||
|
||||
/**
|
||||
* Create product attribute object
|
||||
**/
|
||||
$attributes_obj = new WooSEA_Attributes;
|
||||
$attribute_dropdown = $attributes_obj->get_product_attributes();
|
||||
|
||||
/**
|
||||
* Update or get project configuration
|
||||
*/
|
||||
if (array_key_exists('project_hash', $_GET)){
|
||||
$project = WooSEA_Update_Project::get_project_data(sanitize_text_field($_GET['project_hash']));
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_GET['channel_hash']));
|
||||
$count_mappings = count($project['attributes']);
|
||||
$manage_project = "yes";
|
||||
} else {
|
||||
$project = WooSEA_Update_Project::update_project($_POST);
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_POST['channel_hash']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine next step in configuration flow
|
||||
**/
|
||||
$step = 4;
|
||||
if($channel_data['taxonomy'] != "none"){
|
||||
$step = 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get main currency
|
||||
**/
|
||||
$currency = get_woocommerce_currency();
|
||||
|
||||
/**
|
||||
* Create channel attribute object
|
||||
**/
|
||||
require plugin_dir_path(__FILE__) . '../../classes/channels/class-'.$channel_data['fields'].'.php';
|
||||
$obj = "WooSEA_".$channel_data['fields'];
|
||||
$fields_obj = new $obj;
|
||||
$attributes = $fields_obj->get_channel_attributes();
|
||||
|
||||
/**
|
||||
* Add the Item Group ID attribute for product variations
|
||||
**/
|
||||
if(isset($_POST['product_variations'])){
|
||||
|
||||
$channels_with_item_id = array('google_shopping','facebook_drm');
|
||||
|
||||
if (in_array($project['fields'],$channels_with_item_id,TRUE)){
|
||||
|
||||
$attributes["Detailed product description"]["Item group ID"]["format"] = "required";
|
||||
$attributes["Detailed product description"]["Item group ID"]["woo_suggest"] = "item_group_id";
|
||||
|
||||
if (in_array($project['fields'],$channels_with_item_id,TRUE)){
|
||||
$attributes["Detailed product description"]["Item group ID"]["feed_name"] = "g:item_group_id";
|
||||
} else {
|
||||
$attributes["Detailed product description"]["Item group ID"]["feed_name"] = "item_group_id";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div id="dialog" title="Basic dialog">
|
||||
<p>
|
||||
<div id="dialogText"></div>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="wrap">
|
||||
<div class="woo-product-feed-pro-form-style-2">
|
||||
<div class="woo-product-feed-pro-form-style-2-heading">Field mapping</div>
|
||||
|
||||
<div class="<?php _e($notifications_box['message_type']); ?>">
|
||||
<p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
|
||||
</div>
|
||||
|
||||
<form action="" id="fieldmapping" method="post">
|
||||
<table class="woo-product-feed-pro-table" id="woosea-fieldmapping-table" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>
|
||||
<?php
|
||||
print "$channel_data[name] attributes";
|
||||
?>
|
||||
</th>
|
||||
<th>Prefix</th>
|
||||
<th>Value</th>
|
||||
<th>Suffix</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="woo-product-feed-pro-body">
|
||||
<?php
|
||||
if (!isset($count_mappings)){
|
||||
$c = 0;
|
||||
|
||||
foreach($attributes as $row_key => $row_value){
|
||||
foreach($row_value as $row_k => $row_v){
|
||||
if ($row_v['format'] == "required"){
|
||||
?>
|
||||
<tr class="rowCount">
|
||||
<td><input type="hidden" name="attributes[<?php print "$c";?>][rowCount]" value="<?php print "$c";?>"><input type="checkbox" name="record" class="checkbox-field"></td>
|
||||
<td>
|
||||
<select name="attributes[<?php print"$c"; ?>][attribute]" class="select-field">
|
||||
<?php
|
||||
foreach($attributes as $key => $value) {
|
||||
print "<optgroup label='$key'><strong>$key</strong>";
|
||||
|
||||
foreach($value as $k => $v){
|
||||
if($v['feed_name'] == $row_v['feed_name']){
|
||||
if (array_key_exists('name',$v)){
|
||||
$dialog_value = $v['feed_name'];
|
||||
print "<option value='$v[feed_name]' selected>$k ($v[name])</option>";
|
||||
} else {
|
||||
print "<option value='$v[feed_name]' selected>$k</option>";
|
||||
}
|
||||
} else {
|
||||
if (array_key_exists('name',$v)){
|
||||
print "<option value='$v[feed_name]'>$k ($v[name])</option>";
|
||||
} else {
|
||||
print "<option value='$v[feed_name]'>$k</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if($row_v['feed_name'] == "g:price"){
|
||||
print "<input type='text' name='attributes[$c][prefix]' value='$currency' class='input-field-medium'>";
|
||||
} else {
|
||||
print "<input type='text' name='attributes[$c][prefix]' class='input-field-medium'>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<select name="attributes[<?php print "$c";?>][mapfrom]" class="select-field">
|
||||
<option></option>
|
||||
<?php
|
||||
foreach($attribute_dropdown as $drop_key => $drop_value){
|
||||
if(array_key_exists("woo_suggest", $row_v) ){
|
||||
if($row_v['woo_suggest'] == $drop_key){
|
||||
print "<option value='$drop_key' selected>$drop_value</option>";
|
||||
} else {
|
||||
print "<option value='$drop_key'>$drop_value</option>";
|
||||
}
|
||||
} else {
|
||||
print "<option value='$drop_key'>$drop_value</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="attributes[<?php print "$c";?>][suffix]" class="input-field-medium">
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$c++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($project['attributes'] as $attribute_key => $attribute_array){
|
||||
if(isset($project['attributes'][$attribute_key]['prefix'])){
|
||||
$prefix = $project['attributes'][$attribute_key]['prefix'];
|
||||
}
|
||||
if(isset($project['attributes'][$attribute_key]['suffix'])){
|
||||
$suffix = $project['attributes'][$attribute_key]['suffix'];
|
||||
}
|
||||
?>
|
||||
<tr class="rowCount">
|
||||
<td><input type="hidden" name="attributes[<?php print "$attribute_key";?>][rowCount]" value="<?php print "$attribute_key";?>"><input type="checkbox" name="record" class="checkbox-field"></td>
|
||||
<td>
|
||||
<select name="attributes[<?php print"$attribute_key"; ?>][attribute]" class="select-field">
|
||||
<?php
|
||||
print "<option value=\"$attribute_array[attribute]\">$attribute_array[attribute]</option>";
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="attributes[<?php print "$attribute_key";?>][prefix]" class="input-field-medium" value="<?php print "$prefix";?>">
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<?php
|
||||
if(array_key_exists('static_value', $attribute_array)){
|
||||
print "<input type=\"text\" name=\"attributes[$attribute_key][mapfrom]\" class=\"input-field-midsmall\" value=\"$attribute_array[mapfrom]\"><input type=\"hidden\" name=\"attributes[$attribute_key][static_value]\" value=\"true\">";
|
||||
} else {
|
||||
?>
|
||||
<select name="attributes[<?php print "$attribute_key";?>][mapfrom]" class="select-field">
|
||||
<option></option>
|
||||
<?php
|
||||
foreach($attribute_dropdown as $drop_key => $drop_value){
|
||||
if($project['attributes'][$attribute_key]['mapfrom'] == $drop_key){
|
||||
print "<option value='$drop_key' selected>$drop_value</option>";
|
||||
} else {
|
||||
print "<option value='$drop_key'>$drop_value</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php }
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="attributes[<?php print "$attribute_key";?>][suffix]" class="input-field-medium" value="<?php print "$suffix";?>">
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<input type="hidden" id="channel_hash" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
|
||||
<?php
|
||||
if(isset($manage_project)){
|
||||
?>
|
||||
<input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="step" value="100">
|
||||
<input type="button" class="delete-field-mapping" value="- Delete"> <input type="button" class="add-field-mapping" value="+ Add field mapping"> <input type="button" class="add-own-mapping" value="+ Add custom field"> <input type="submit" id="savebutton" value="Save" />
|
||||
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="step" value="<?php print "$step";?>">
|
||||
<input type="button" class="delete-field-mapping" value="- Delete"> <input type="button" class="add-field-mapping" value="+ Add field mapping"> <input type="button" class="add-own-mapping" value="+ Add custom field"> <input type="submit" id="savebutton" value="Save" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,600 @@
|
||||
<?php
|
||||
$my_currency = get_woocommerce_currency();
|
||||
$aelia_currencies = apply_filters('wc_aelia_cs_enabled_currencies', $my_currency);
|
||||
$host = $_SERVER['HTTP_HOST'];
|
||||
|
||||
/**
|
||||
* Change default footer text, asking to review our plugin
|
||||
**/
|
||||
function my_footer_text($default) {
|
||||
return _e( 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">★★★★★</a> rating. Thanks in advance!','woo-product-feed-pro') ;
|
||||
}
|
||||
add_filter('admin_footer_text', 'my_footer_text');
|
||||
|
||||
/**
|
||||
* Create notification object and get message and message type as WooCommerce is inactive
|
||||
* also set variable allowed on 0 to disable submit button on step 1 of configuration
|
||||
*/
|
||||
$versions = array (
|
||||
"PHP" => (float)phpversion(),
|
||||
"Wordpress" => get_bloginfo('version'),
|
||||
"WooCommerce" => WC()->version,
|
||||
"WooCommerce Product Feed PRO" => WOOCOMMERCESEA_PLUGIN_VERSION
|
||||
);
|
||||
|
||||
$license_information = get_option( 'license_information' );
|
||||
|
||||
$notifications_obj = new WooSEA_Get_Admin_Notifications;
|
||||
if (!in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( "9", "false" );
|
||||
$locale = "NL";
|
||||
} else {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '0', 'false' );
|
||||
$default = wc_get_base_location();
|
||||
$locale = apply_filters( 'woocommerce_countries_base_country', $default['country'] );
|
||||
}
|
||||
|
||||
if (!empty($license_information)){
|
||||
if($license_information['notice'] == "true"){
|
||||
$notifications_box['message_type'] = $license_information['message_type'];
|
||||
$notifications_box['message'] = $license_information['message'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($versions['PHP'] < 5.6){
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '11', 'false' );
|
||||
}
|
||||
|
||||
if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '12', 'false' );
|
||||
}
|
||||
|
||||
if ($versions['WooCommerce'] < 3){
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '13', 'false' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shipping zones
|
||||
*/
|
||||
$shipping_zones = WC_Shipping_Zones::get_zones();
|
||||
$nr_shipping_zones = count($shipping_zones);
|
||||
|
||||
/**
|
||||
* Get channels
|
||||
*/
|
||||
$channel_configs = get_option ('channel_statics');
|
||||
|
||||
/**
|
||||
* Get countries and channels
|
||||
*/
|
||||
$channel_obj = new WooSEA_Attributes;
|
||||
$countries = $channel_obj->get_channel_countries();
|
||||
$channels = $channel_obj->get_channels($locale);
|
||||
|
||||
if (array_key_exists('project_hash', $_GET)){
|
||||
$project = WooSEA_Update_Project::get_project_data(sanitize_text_field($_GET['project_hash']));
|
||||
$manage_project = "yes";
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<div class="woo-product-feed-pro-form-style-2">
|
||||
<?php
|
||||
// Set default notification to show
|
||||
$getelite_notice = get_option('woosea_getelite_notification');
|
||||
if(empty($getelite_notice['show'])){
|
||||
$getelite_notice['show'] = "yes";
|
||||
$getelite_notice['timestamp'] = date( 'd-m-Y' );
|
||||
}
|
||||
|
||||
if($getelite_notice['show'] <> "no"){
|
||||
?>
|
||||
<div class="notice notice-info get_elite is-dismissible">
|
||||
<p>
|
||||
<strong><?php _e( 'Would you like to get more out of your product feeds? Upgrade to the Elite version of the plugin and you will get:','woo-product-feed-pro' );?></strong><br/></br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'Priority support - we will help you to get your product feed(s) up-and-running;','woo-product-feed-pro' );?><br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'GTIN, Brand, MPN, EAN, Condition and more fields for your product feeds','woo-product-feed-pro' );?> [<a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=adding%20fields" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e('Enhanched structured data on your product pages: more products approved in your Google Merchant Center','woo-product-feed-pro' );?> [<a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=structured%20data%20bug" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'Advanced product data manipulation','woo-product-feed-pro' );?> [<a href="https://adtribes.io/feature-product-data-manipulation/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=product%20data%20manipulation" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'WPML support - including their currency switcher','woo-product-feed-pro' );?> [<a href="https://adtribes.io/wpml-support/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=wpml%20support" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'Polylang support','woo-product-feed-pro' );?> [<a href="https://adtribes.io/polylang-support-product-feeds/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=polylang%20support" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
|
||||
<span class="dashicons dashicons-yes"></span>Aelia currency switcher support [<a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=aelia%20support" target="_blank">Read more</a>];<br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'Facebook pixel feature','woo-product-feed-pro' );?> [<a href="https://adtribes.io/facebook-pixel-feature/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=facebook pixel feature" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/><br/>
|
||||
<?php _e( 'Upgrade to the','woo-product-feed-pro' );?> <strong><a href="https://adtribes.io/pro-vs-elite/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=top-notification&utm_content=notification" target="_blank"><?php _e( 'Elite version of our plugin</a></strong> to get all these features.','woo-product-feed-pro' );?>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-form-style-2-heading"><?php _e( 'General feed settings','woo-product-feed-pro' );?></div>
|
||||
|
||||
<form action="" id="myForm" method="post" name="myForm">
|
||||
|
||||
<div class="woo-product-feed-pro-table-wrapper">
|
||||
<div class="woo-product-feed-pro-table-left">
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tbody class="woo-product-feed-pro-body">
|
||||
<div id="projecterror"></div>
|
||||
<tr>
|
||||
<td width="30%"><span><?php _e( 'Project name','woo-product-feed-pro' );?>:<span class="required">*</span></span></td>
|
||||
<td>
|
||||
<div style="display: block;">
|
||||
<?php
|
||||
if (isset($project)){
|
||||
print"<input type=\"text\" class=\"input-field\" id=\"projectname\" name=\"projectname\" value=\"$project[projectname]\"/> <div id=\"projecterror\"></div>";
|
||||
} else {
|
||||
print"<input type=\"text\" class=\"input-field\" id=\"projectname\" name=\"projectname\"/> <div id=\"projecterror\"></div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$add_aelia_support = get_option ('add_aelia_support');
|
||||
if($add_aelia_support == "yes"){
|
||||
if ((is_array($aelia_currencies)) AND (count($aelia_currencies) > 0)){
|
||||
if (isset($manage_project)){
|
||||
print "<tr>";
|
||||
print " <td><span>Aelia Currency:</span></td>";
|
||||
print " <td>";
|
||||
print " <select name=\"AELIA\" class=\"aelia_switch\">";
|
||||
foreach ($aelia_currencies as $key => $value){
|
||||
if(isset($project['AELIA'])){
|
||||
if($value == $project['AELIA']){
|
||||
print "<option value=\"$value\" selected>$value</option>";
|
||||
} else {
|
||||
print "<option value=\"$value\">$value</option>";
|
||||
}
|
||||
} else {
|
||||
print "<option value=\"$value\">$value</option>";
|
||||
}
|
||||
}
|
||||
print "</select>";
|
||||
print "<input type=\"hidden\" name=\"base_currency\" value=\"$my_currency\">";
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
} else {
|
||||
print "<tr>";
|
||||
print " <td><span>Aelia Currency:</span></td>";
|
||||
print " <td>";
|
||||
print " <select name=\"AELIA\">";
|
||||
foreach ($aelia_currencies as $key => $value){
|
||||
if($value == $my_currency){
|
||||
print "<option value=\"$value\" selected>$value</option>";
|
||||
} else {
|
||||
print "<option value=\"$value\">$value</option>";
|
||||
}
|
||||
}
|
||||
print "</select>";
|
||||
print "<input type=\"hidden\" name=\"base_currency\" value=\"$my_currency\">";
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( is_plugin_active('sitepress-multilingual-cms') ) OR ( function_exists('icl_object_id') ) ){
|
||||
|
||||
// This is WPML
|
||||
if( !class_exists( 'Polylang' ) ) {
|
||||
$add_wpml_support = get_option ('add_wpml_support');
|
||||
if($add_wpml_support == "yes"){
|
||||
// Adding WPML support here
|
||||
$my_current_lang = apply_filters( 'wpml_current_language', NULL );
|
||||
|
||||
global $sitepress;
|
||||
$list_lang = $sitepress->get_active_languages();
|
||||
$nr_lang = count($list_lang);
|
||||
|
||||
$wcml_currencies = array();
|
||||
// Check if WCML plugin is active
|
||||
if ( function_exists('wcml_loader') ) {
|
||||
$wcml_settings = get_option('_wcml_settings');
|
||||
$currencies = $wcml_settings['currency_options'];
|
||||
|
||||
foreach ($currencies as $cur_key => $cur_val){
|
||||
array_push($wcml_currencies, $cur_key);
|
||||
}
|
||||
}
|
||||
|
||||
if($nr_lang > 0){
|
||||
if (isset($manage_project)){
|
||||
print "<tr>";
|
||||
print "<td><span>WPML Language:</span></td>";
|
||||
print "<td>";
|
||||
print "<select name=\"WPML\" disabled>";
|
||||
foreach ($list_lang as $key => $value){
|
||||
if($key == $project['WPML']){
|
||||
print "<option value=\"$key\" selected>$value[english_name]</option>";
|
||||
} else {
|
||||
print "<option value=\"$key\">$value[english_name]</option>";
|
||||
}
|
||||
}
|
||||
print "</select>";
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
|
||||
if((count($wcml_currencies) > 0) AND ($wcml_settings['enable_multi_currency'] > 0)){
|
||||
print "<tr>";
|
||||
print "<td><span>WCML Currency:</span></td>";
|
||||
print "<td>";
|
||||
print "<select name=\"WCML\" disabled>";
|
||||
foreach ($wcml_currencies as $key => $value){
|
||||
if($value == $project['WCML']){
|
||||
print "<option value=\"$value\" selected>$value</option>";
|
||||
} else {
|
||||
print "<option value=\"$value\">$value</option>";
|
||||
}
|
||||
}
|
||||
print "</select>";
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
} else {
|
||||
print "<tr>";
|
||||
print "<td><span>WPML Language:</span></td>";
|
||||
print "<td>";
|
||||
print "<select name=\"WPML\">";
|
||||
foreach ($list_lang as $key => $value){
|
||||
if($key == $my_current_lang){
|
||||
print "<option value=\"$key\" selected>$value[english_name]</option>";
|
||||
} else {
|
||||
print "<option value=\"$key\">$value[english_name]</option>";
|
||||
}
|
||||
}
|
||||
print "</select>";
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
|
||||
if((count($wcml_currencies) > 0) AND ($wcml_settings['enable_multi_currency'] > 0)){
|
||||
$my_currency = get_woocommerce_currency();
|
||||
print "<tr>";
|
||||
print "<td><span>WCML Currency:</span></td>";
|
||||
print "<td>";
|
||||
print "<select name=\"WCML\">";
|
||||
foreach ($wcml_currencies as $key => $value){
|
||||
if($value == $my_currency){
|
||||
print "<option value=\"$value\" selected>$value</option>";
|
||||
} else {
|
||||
print "<option value=\"$value\">$value</option>";
|
||||
}
|
||||
}
|
||||
print "</select>";
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><span><?php _e( 'Country','woo-product-feed-pro' );?>:</span></td>
|
||||
<td>
|
||||
<?php
|
||||
if (isset($manage_project)){
|
||||
//print"<select name=\"countries\" id=\"countries\" class=\"select-field\" disabled>";
|
||||
print"<select name=\"countries\" id=\"countries\" class=\"select-field\">";
|
||||
} else {
|
||||
print"<select name=\"countries\" id=\"countries\" class=\"select-field\">";
|
||||
}
|
||||
?>
|
||||
<option><?php _e( 'Select a country','woo-product-feed-pro' );?></option>
|
||||
<?php
|
||||
foreach ($countries as $value){
|
||||
if((isset($project)) AND ($value == $project['countries'])){
|
||||
print "<option value=\"$value\" selected>$value</option>";
|
||||
} else {
|
||||
print "<option value=\"$value\">$value</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span><?php _e( 'Channel','woo-product-feed-pro' );?>:</span></td>
|
||||
<td>
|
||||
<?php
|
||||
if (isset($manage_project)){
|
||||
print "<select name=\"channel_hash\" id=\"channel_hash\" class=\"select-field\" disabled>";
|
||||
print "<option value=\"$project[channel_hash]\" selected>$project[name]</option>";
|
||||
print "</select>";
|
||||
} else {
|
||||
$customfeed = "";
|
||||
$advertising = "";
|
||||
$marketplace = "";
|
||||
$shopping = "";
|
||||
$optgroup_customfeed = 0;
|
||||
$optgroup_advertising = 0;
|
||||
$optgroup_marketplace = 0;
|
||||
$optgroup_shopping = 0;
|
||||
|
||||
print "<select name=\"channel_hash\" id=\"channel_hash\" class=\"select-field\">";
|
||||
|
||||
foreach ($channels as $key=>$val){
|
||||
if ($val['type'] == "Custom Feed"){
|
||||
if ($optgroup_customfeed == 1){
|
||||
if((isset($project)) AND ($val['channel_hash'] == $project['channel_hash'])){
|
||||
$customfeed .= "<option value=\"$val[channel_hash]\" selected>$key</option>";
|
||||
} else {
|
||||
$customfeed .= "<option value=\"$val[channel_hash]\">$key</option>";
|
||||
}
|
||||
} else {
|
||||
$customfeed = "<optgroup label=\"Custom Feed\">";
|
||||
if((isset($project)) AND ($val['channel_hash'] == $project['channel_hash'])){
|
||||
$customfeed .= "<option value=\"$val[channel_hash]\" selected>$key</option>";
|
||||
} else {
|
||||
$customfeed .= "<option value=\"$val[channel_hash]\">$key</option>";
|
||||
}
|
||||
$optgroup_customfeed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($val['type'] == "Advertising"){
|
||||
if ($optgroup_advertising == 1){
|
||||
if((isset($project)) AND ($val['channel_hash'] == $project['channel_hash'])){
|
||||
$advertising .= "<option value=\"$val[channel_hash]\" selected>$key</option>";
|
||||
} else {
|
||||
$advertising .= "<option value=\"$val[channel_hash]\">$key</option>";
|
||||
}
|
||||
} else {
|
||||
$advertising = "<optgroup label=\"Advertising\">";
|
||||
if((isset($project)) AND ($val['channel_hash'] == $project['channel_hash'])){
|
||||
$advertising .= "<option value=\"$val[channel_hash]\" selected>$key</option>";
|
||||
} else {
|
||||
$advertising .= "<option value=\"$val[channel_hash]\">$key</option>";
|
||||
}
|
||||
$optgroup_advertising = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($val['type'] == "Marketplace"){
|
||||
if ($optgroup_marketplace == 1){
|
||||
if((isset($project)) AND ($val['channel_hash'] == $project['channel_hash'])){
|
||||
$marketplace .= "<option value=\"$val[channel_hash]\" selected>$key</option>";
|
||||
} else {
|
||||
$marketplace .= "<option value=\"$val[channel_hash]\">$key</option>";
|
||||
}
|
||||
} else {
|
||||
$marketplace = "<optgroup label=\"Marketplace\">";
|
||||
if((isset($project)) AND ($val['channel_hash'] == $project['channel_hash'])){
|
||||
$marketplace .= "<option value=\"$val[channel_hash]\" selected>$key</option>";
|
||||
} else {
|
||||
$marketplace .= "<option value=\"$val[channel_hash]\">$key</option>";
|
||||
}
|
||||
$optgroup_marketplace = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($val['type'] == "Comparison shopping engine"){
|
||||
if ($optgroup_shopping == 0){
|
||||
if((isset($project)) AND ($val['channel_hash'] == $project['channel_hash'])){
|
||||
$shopping .= "<option value=\"$val[channel_hash]\" selected>$key</option>";
|
||||
} else {
|
||||
$shopping .= "<option value=\"$val[channel_hash]\">$key</option>";
|
||||
}
|
||||
} else {
|
||||
$shopping = "<optgroup label=\"Comparison Shopping Engine\">";
|
||||
if((isset($project)) AND ($val['channel_hash'] == $project['channel_hash'])){
|
||||
$shopping .= "<option value=\"$val[channel_hash]\">$key</option>";
|
||||
} else {
|
||||
$shopping .= "<option value=\"$val[channel_hash]\" selected>$key</option>";
|
||||
}
|
||||
$optgroup_shopping = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
print "$customfeed";
|
||||
print "$advertising";
|
||||
print "$marketplace";
|
||||
print "$shopping";
|
||||
print "</select>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="product_variations">
|
||||
<td><span><?php _e('Include product variations','woo-product-feed-pro' );?>:</span></td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
if(isset($project['product_variations'])){
|
||||
print "<input type=\"checkbox\" id=\"variations\" name=\"product_variations\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"variations\" name=\"product_variations\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="default_variation">
|
||||
<td><span><?php _e( 'And only include default product variation','woo-product-feed-pro' );?>:</span></td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
if(isset($project['default_variations'])){
|
||||
print "<input type=\"checkbox\" id=\"default_variations\" name=\"default_variations\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"default_variations\" name=\"default_variations\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="lowest_price_variation">
|
||||
<td><span><?php _e( 'And only include lowest priced product variation(s)','woo-product-feed-pro' );?>:</span></td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
if(isset($project['lowest_price_variations'])){
|
||||
print "<input type=\"checkbox\" id=\"lowest_price_variations\" name=\"lowest_price_variations\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"lowest_price_variations\" name=\"lowest_price_variations\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="file">
|
||||
<td><span><?php _e( 'File format','woo-product-feed-pro' );?>:</span></td>
|
||||
<td>
|
||||
<select name="fileformat" id="fileformat" class="select-field">
|
||||
<?php
|
||||
$format_arr = array("xml","csv","txt","tsv");
|
||||
foreach ($format_arr as $format){
|
||||
$format_upper = strtoupper($format);
|
||||
if ((isset($project)) AND ($format == $project['fileformat'])){
|
||||
print "<option value=\"$format\" selected>$format_upper</option>";
|
||||
} else {
|
||||
print "<option value=\"$format\">$format_upper</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="delimiter">
|
||||
<td><span><?php _e( 'Delimiter','woo-product-feed-pro' );?>:</span></td>
|
||||
<td>
|
||||
<select name="delimiter" class="select-field">
|
||||
<?php
|
||||
$delimiter_arr = array(",","|",";","tab","#");
|
||||
foreach ($delimiter_arr as $delimiter){
|
||||
if((isset($project)) AND (array_key_exists('delimiter', $project)) AND ($delimiter == $project['delimiter'])){
|
||||
print "<option value=\"$delimiter\" selected>$delimiter</option>";
|
||||
} else {
|
||||
print "<option value=\"$delimiter\">$delimiter</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span><?php _e( 'Refresh interval','woo-product-feed-pro' );?>:</span></td>
|
||||
<td>
|
||||
<select name="cron" class="select-field">
|
||||
<?php
|
||||
$refresh_arr = array("daily","twicedaily","hourly","no refresh");
|
||||
foreach ($refresh_arr as $refresh){
|
||||
$refresh_upper = ucfirst($refresh);
|
||||
if ((isset($project)) AND ($refresh == $project['cron'])){
|
||||
print "<option value=\"$refresh\" selected>$refresh_upper</option>";
|
||||
} else {
|
||||
print "<option value=\"$refresh\">$refresh_upper</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><span><?php _e( 'Refresh only when products changed','woo-product-feed-pro' );?>:</span></td>
|
||||
<td>
|
||||
<?php
|
||||
if((isset($project)) AND (array_key_exists('products_changed',$project))){
|
||||
print "<input name=\"products_changed\" type=\"checkbox\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input name=\"products_changed\" type=\"checkbox\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php
|
||||
if (isset($project)){
|
||||
print "<input type=\"hidden\" name=\"project_hash\" id=\"project_hash\" value=\"$project[project_hash]\" />";
|
||||
print "<input type=\"hidden\" name=\"channel_hash\" id=\"channel_hash\" value=\"$project[channel_hash]\" />";
|
||||
print "<input type=\"hidden\" name=\"project_update\" id=\"project_update\" value=\"yes\" />";
|
||||
print "<input type=\"hidden\" name=\"step\" id=\"step\" value=\"100\" />";
|
||||
print "<input type=\"submit\" id=\"goforit\" value=\"Save\" />";
|
||||
|
||||
} else {
|
||||
print "<input type=\"hidden\" name=\"step\" id=\"step\" value=\"99\" />";
|
||||
print "<input type=\"submit\" id=\"goforit\" value=\"Save & continue\" />";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="woo-product-feed-pro-table-right">
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong><?php _e( 'Why upgrade to Elite?','woo-product-feed-pro' );?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php _e( 'Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!','woo-product-feed-pro' );?>
|
||||
<ul>
|
||||
<li><strong>1.</strong> <?php _e( 'Priority support: get your feeds live faster','woo-product-feed-pro' );?></li>
|
||||
<li><strong>2.</strong> <?php _e( 'More products approved by Google','woo-product-feed-pro' );?></li>
|
||||
<li><strong>3.</strong> <?php _e( 'Add GTIN, brand and more fields to your store','woo-product-feed-pro' );?></li>
|
||||
<li><strong>4.</strong> <?php _e( 'Exclude individual products from your feeds','woo-product-feed-pro' );?></li>
|
||||
<li><strong>5.</strong> <?php _e( 'WPML support','woo-product-feed-pro' );?></li>
|
||||
<li><strong>6.</strong> <?php _e( 'Aelia currency switcher support','woo-product-feed-pro' );?></li>
|
||||
<li><strong>7.</strong> <?php _e( 'Facebook pixel feature','woo-product-feed-pro' );?></li>
|
||||
<li><strong>8.</strong> <?php _e( 'Polylang support','woo-product-feed-pro' );?></li>
|
||||
</ul>
|
||||
<strong>
|
||||
<a href="https://adtribes.io/pro-vs-elite/?utm_source=<?php print"$host";?>&utm_medium=page-0&utm_campaign=why-upgrade-box" target="_blank"><?php _e( 'Upgrade to Elite here!','woo-product-feed-pro' );?></a>
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong><?php _e( 'We’ve got you covered!','woo-product-feed-pro' );?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php _e( 'Need assistance? Check out our:','woo-product-feed-pro' );?>
|
||||
<ul>
|
||||
<li><strong><a href="https://adtribes.io/support/?utm_source=<?php print"$host";?>&utm_medium=page-0&utm_campaign=faq" target="_blank"><?php _e( 'Frequently Asked Questions','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank"><?php _e( 'YouTube tutorials','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong><a href="https://adtribes.io/tutorials/?utm_source=<?php print "$host";?>&utm_medium=page-0&utm_campaign=tutorials" target="_blank"><?php _e( 'Tutorials','woo-product-feed-pro' );?></a></strong></li>
|
||||
</ul>
|
||||
<?php _e( 'Or just reach out to us at','woo-product-feed-pro' );?> <strong><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/" target="_blank"><?php _e( 'our Wordpress forum','woo-product-feed-pro' );?></a></strong> <?php _e( 'and we will make sure your product feeds will be up-and-running within no-time.','woo-product-feed-pro' );?>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong><?php _e( 'Our latest tutorials','woo-product-feed-pro' );?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li><strong>1. <a href="https://adtribes.io/setting-up-your-first-google-shopping-product-feed/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=first shopping feed" target="_blank"><?php _e( 'Create a Google Shopping feed','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>2. <a href="https://adtribes.io/feature-product-data-manipulation/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=product_data_manipulation" target="_blank"><?php _e( 'Product data manipulation','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>3. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=how to create filters" target="_blank"><?php _e( 'How to create filters for your product feed','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>4. <a href="https://adtribes.io/how-to-create-rules/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=how to create rules" target="_blank"><?php _e('How to set rules for your product feed','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>5. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=adding fields" target="_blank"><?php _e( 'Adding GTIN, Brand, MPN and more','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>6. <a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=structured data bug" target="_blank"><?php _e('WooCommerce structured data markup bug','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>7. <a href="https://adtribes.io/wpml-support/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=wpml support" target="_blank"><?php _e( 'Enable WPML support','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>8. <a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=aelia support" target="_blank"><?php _e( 'Enable Aelia currency switcher support','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>9. <a href="https://adtribes.io/help-my-feed-processing-is-stuck/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=feed stuck" target="_blank"><?php _e( 'Help, my feed is stuck!','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>10. <a href="https://adtribes.io/help-i-have-none-or-less-products-in-my-product-feed-than-expected/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=too few products" target="_blank"><?php _e( 'Help, my feed has no or too few products!','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>11. <a href="https://adtribes.io/polylang-support-product-feeds/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=polylang support" target="_blank"><?php _e( 'How to use the Polylang feature', 'woo-product-feed-pro' );?></a></strong></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,317 @@
|
||||
<?php
|
||||
/**
|
||||
* Change default footer text, asking to review our plugin
|
||||
**/
|
||||
function my_footer_text($default) {
|
||||
return _e( 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">★★★★★</a> rating. Thanks in advance!','woo-product-feed-pro');
|
||||
}
|
||||
add_filter('admin_footer_text', 'my_footer_text');
|
||||
delete_option( 'woosea_cat_mapping' );
|
||||
$license_information = get_option( 'license_information' );
|
||||
$host = sanitize_text_field($_SERVER['HTTP_HOST']);
|
||||
|
||||
/**
|
||||
* Create notification object
|
||||
*/
|
||||
$notifications_obj = new WooSEA_Get_Admin_Notifications;
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '1', 'false' );
|
||||
|
||||
/**
|
||||
* Update or get project configuration
|
||||
*/
|
||||
$nonce = wp_create_nonce( 'woosea_ajax_nonce' );
|
||||
|
||||
/**
|
||||
* Update project configuration
|
||||
*/
|
||||
if (array_key_exists('project_hash', $_GET)){
|
||||
$project = WooSEA_Update_Project::get_project_data(sanitize_text_field($_GET['project_hash']));
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_GET['channel_hash']));
|
||||
$manage_project = "yes";
|
||||
|
||||
if(isset($project['WPML'])){
|
||||
if ( ( is_plugin_active('sitepress-multilingual-cms') ) OR ( function_exists('icl_object_id') ) ){
|
||||
if( !class_exists( 'Polylang' ) ) {
|
||||
// Get WPML language
|
||||
global $sitepress;
|
||||
$lang = $project['WPML'];
|
||||
$sitepress->switch_lang($lang);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Sanitize values in multi-dimensional POST array
|
||||
if(is_array($_POST)){
|
||||
foreach($_POST as $p_key => $p_value){
|
||||
if(is_array($p_value)){
|
||||
foreach($p_value as $pp_key => $pp_value){
|
||||
if(is_array($pp_value)){
|
||||
foreach($pp_value as $ppp_key => $ppp_value){
|
||||
$_POST[$p_key][$pp_key][$ppp_key] = sanitize_text_field($ppp_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_POST[$p_key] = sanitize_text_field($p_value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_POST = array();
|
||||
}
|
||||
$project = WooSEA_Update_Project::update_project($_POST);
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_POST['channel_hash']));
|
||||
|
||||
if(isset($project['WPML'])){
|
||||
if ( function_exists('icl_object_id') ) {
|
||||
if( !class_exists( 'Polylang' ) ) {
|
||||
// Get WPML language
|
||||
global $sitepress;
|
||||
$lang = $project['WPML'];
|
||||
$sitepress->switch_lang($lang);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function woosea_hierarchical_term_tree($category, $prev_mapped){
|
||||
$r = '';
|
||||
|
||||
$args = array(
|
||||
'parent' => $category,
|
||||
'hide_empty' => false,
|
||||
'no_found_rows' => true,
|
||||
);
|
||||
|
||||
$next = get_terms('product_cat', $args);
|
||||
$nr_categories = count($next);
|
||||
$yo = 0;
|
||||
|
||||
if ($next) {
|
||||
foreach ($next as $sub_category) {
|
||||
$yo++;
|
||||
$x = $sub_category->term_id;
|
||||
$woo_category = $sub_category->name;
|
||||
$woo_category_id = $sub_category->term_id;
|
||||
|
||||
$mapped_category = "";
|
||||
$mapped_active_class = "input-field-large";
|
||||
$woo_category = preg_replace('/&/','&',$woo_category);
|
||||
$woo_category = preg_replace('/"/','"',$woo_category);
|
||||
|
||||
// Check if mapping is in place
|
||||
if ((array_key_exists($x, $prev_mapped)) OR (array_key_exists($woo_category, $prev_mapped))){
|
||||
if(array_key_exists($x, $prev_mapped)){
|
||||
$mapped_category = $prev_mapped[$x];
|
||||
} elseif (array_key_exists($woo_category, $prev_mapped)){
|
||||
$mapped_category = $prev_mapped[$x];
|
||||
} else {
|
||||
$mapped_category = $woo_category;
|
||||
}
|
||||
$mapped_active_class = "input-field-large-active";
|
||||
}
|
||||
|
||||
// These are main categories
|
||||
if($sub_category->parent == 0){
|
||||
$args = array(
|
||||
'parent' => $sub_category->term_id,
|
||||
'hide_empty' => false,
|
||||
'no_found_rows' => true,
|
||||
);
|
||||
|
||||
$subcat = get_terms('product_cat', $args);
|
||||
$nr_subcats = count($subcat);
|
||||
|
||||
$r .= "<tr class=\"catmapping\">";
|
||||
$r .= "<td><input type=\"hidden\" name=\"mappings[$x][rowCount]\" value=\"$x\"><input type=\"hidden\" name=\"mappings[$x][categoryId]\" value=\"$woo_category_id\"><input type=\"hidden\" name=\"mappings[$x][criteria]\" class=\"input-field-large\" id=\"$woo_category_id\" value=\"$woo_category\">$woo_category ($sub_category->count)</td>";
|
||||
$r .= "<td><div id=\"the-basics-$x\"><input type=\"text\" name=\"mappings[$x][map_to_category]\" class=\"$mapped_active_class js-typeahead js-autosuggest autocomplete_$x\" value=\"$mapped_category\"></div></td>";
|
||||
if(($yo == $nr_categories) AND ($nr_subcats == 0)){
|
||||
$r .= "<td><span class=\"copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to all others\"></span></td>";
|
||||
} else {
|
||||
if($nr_subcats > 0){
|
||||
$r .= "<td><span class=\"dashicons dashicons-arrow-down copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to subcategories\"></span><span class=\"dashicons dashicons-arrow-down-alt copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to all others\"></span></td>";
|
||||
} else {
|
||||
$r .= "<td><span class=\"dashicons dashicons-arrow-down-alt copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to all others\"></span></td>";
|
||||
}
|
||||
}
|
||||
$r .= "</tr>";
|
||||
} else {
|
||||
$r .= "<tr class=\"catmapping\">";
|
||||
$r .= "<td><input type=\"hidden\" name=\"mappings[$x][rowCount]\" value=\"$x\"><input type=\"hidden\" name=\"mappings[$x][categoryId]\" value=\"$woo_category_id\"><input type=\"hidden\" name=\"mappings[$x][criteria]\" class=\"input-field-large\" id=\"$woo_category_id\" value=\"$woo_category\">-- $woo_category ($sub_category->count)</td>";
|
||||
$r .= "<td><div id=\"the-basics-$x\"><input type=\"text\" name=\"mappings[$x][map_to_category]\" class=\"$mapped_active_class js-typeahead js-autosuggest autocomplete_$x mother_$sub_category->parent\" value=\"$mapped_category\"></div></td>";
|
||||
$r .= "<td><span class=\"copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to all others\"></span></td>";
|
||||
$r .= "</tr>";
|
||||
}
|
||||
$r .= $sub_category->term_id !== 0 ? woosea_hierarchical_term_tree($sub_category->term_id, $prev_mapped) : null;
|
||||
}
|
||||
}
|
||||
|
||||
$allowed_tags = array(
|
||||
'tr' => array(
|
||||
'class' => array(),
|
||||
),
|
||||
'td' => array(),
|
||||
'input' => array(
|
||||
'type' => array(),
|
||||
'name' => array(),
|
||||
'value' => array(),
|
||||
'class' => array(),
|
||||
'id' => array(),
|
||||
),
|
||||
'span' => array(
|
||||
'class' => array(),
|
||||
'style' => array(),
|
||||
'title' => array(),
|
||||
),
|
||||
'div' => array(
|
||||
'id' => array(),
|
||||
),
|
||||
'>' => array(),
|
||||
'&' => array(),
|
||||
);
|
||||
return wp_kses_normalize_entities($r, $allowed_tags);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<div class="woo-product-feed-pro-form-style-2">
|
||||
<div class="woo-product-feed-pro-form-style-2-heading"><?php _e( 'Category mapping','woo-product-feed-pro' );?></div>
|
||||
|
||||
<div class="<?php _e($notifications_box['message_type']); ?>">
|
||||
<p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="woo-product-feed-pro-table-wrapper">
|
||||
<div class="woo-product-feed-pro-table-left">
|
||||
|
||||
<table id="woosea-ajax-mapping-table" class="woo-product-feed-pro-table" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php _e( 'Your category','woo-product-feed-pro' );?> <i>(<?php _e( 'Number of products','woo-product-feed-pro' );?>)</i></th>
|
||||
<th><?php print "$channel_data[name]";?> <?php _e( 'category','woo-product-feed-pro' );?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="woo-product-feed-pro-body">
|
||||
<?php
|
||||
// Get already mapped categories
|
||||
$prev_mapped = array();
|
||||
if(isset($project['mappings'])){
|
||||
foreach ($project['mappings'] as $map_key => $map_value){
|
||||
if(strlen($map_value['map_to_category']) > 0){
|
||||
$map_value['criteria'] = str_replace("\\","",$map_value['criteria']);
|
||||
$prev_mapped[$map_value['categoryId']] = $map_value['map_to_category'];
|
||||
// $prev_mapped[$map_value['criteria']] = $map_value['map_to_category'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Display mapping form
|
||||
echo woosea_hierarchical_term_tree(0,$prev_mapped);
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<form action="" method="post">
|
||||
<input name="nonce_category_mapping" id="nonce_category_mapping" class="nonce_category_mapping" value="<?php print "$nonce";?>" type="hidden">
|
||||
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<input type="hidden" id="channel_hash" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
|
||||
<?php
|
||||
if(isset($manage_project)){
|
||||
?>
|
||||
<input type="hidden" name="project_update" id="project_update" value="yes" />
|
||||
<input type="hidden" id="project_hash" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="step" value="100">
|
||||
<input type="submit" value="Save mappings" />
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<input type="hidden" id="project_hash" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="step" value="4">
|
||||
<input type="submit" value="Save mappings" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</form>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="woo-product-feed-pro-table-right">
|
||||
<?php
|
||||
if($license_information['license_valid'] <> "true"){
|
||||
?>
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong><?php _e( 'Why upgrade to Elite?','woo-product-feed-pro' );?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php _e( 'Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!','woo-product-feed-pro' );?>
|
||||
<ul>
|
||||
<li><strong>1.</strong> <?php _e( 'Priority support: get your feeds live faster','woo-product-feed-pro' );?></li>
|
||||
<li><strong>2.</strong> <?php _e( 'More products approved by Google','woo-product-feed-pro' );?></li>
|
||||
<li><strong>3.</strong> <?php _e( 'Add GTIN, brand and more fields to your store','woo-product-feed-pro' );?></li>
|
||||
<li><strong>4.</strong> <?php _e( 'Exclude individual products from your feeds','woo-product-feed-pro' );?></li>
|
||||
<li><strong>5.</strong> <?php _e( 'WPML support','woo-product-feed-pro' );?></li>
|
||||
<li><strong>6.</strong> <?php _e( 'Aelia currency switcher support','woo-product-feed-pro' );?></li>
|
||||
<li><strong>7.</strong> <?php _e( 'Facebook pixel feature','woo-product-feed-pro' );?></li>
|
||||
<li><strong>8.</strong> <?php _e( 'Polylang support','woo-product-feed-pro' );?></li>
|
||||
</ul>
|
||||
<strong>
|
||||
<a href="https://adtribes.io/pro-vs-elite/?utm_source=<?php print"$host";?>&utm_medium=page1&utm_campaign=why-upgrade-box" target="_blank"><?php _e( 'Upgrade to Elite here!','woo-product-feed-pro' );?></a>
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong><?php _e( 'We have got you covered!','woo-product-feed-pro' );?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php _e( 'Need assistance? Check out our:','woo-product-feed-pro' );?>
|
||||
<ul>
|
||||
<li><strong><a href="https://adtribes.io/support/?utm_source=<?php print"$host";?>&utm_medium=page1&utm_campaign=faq" target="_blank"><?php _e( 'Frequently Asked Questions','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank"><?php _e( 'YouTube tutorials','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong><a href="https://adtribes.io/tutorials/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=tutorials" target="_blank"><?php _e( 'Tutorials','woo-product-feed-pro' );?></a></strong></li>
|
||||
</ul>
|
||||
<?php _e ('Or just reach out to us at','woo-product-feed-pro' );?> <strong><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/" target="_blank"><?php _e( 'our Wordpress forum','woo-product-feed-pro' );?></a></strong> <?php _e( 'and we will make sure your product feeds will be up-and-running within no-time.','woo-product-feed-pro' );?>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong><?php _e( 'Our latest tutorials','woo-product-feed-pro' );?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li><strong>1. <a href="https://adtribes.io/setting-up-your-first-google-shopping-product-feed/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=first shopping feed" target="_blank"><?php _e( 'Create a Google Shopping feed','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>2. <a href="https://adtribes.io/feature-product-data-manipulation/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=product_data_manipulation" target="_blank"><?php _e( 'Product data manipulation','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>3. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=how to create filters" target="_blank"><?php _e( 'How to create filters for your product feed','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>4. <a href="https://adtribes.io/how-to-create-rules/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=how to create rules" target="_blank"><?php _e( 'How to set rules for your product feed','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>5. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=adding fields" target="_blank"><?php _e( 'Adding GTIN, Brand, MPN and more','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>6. <a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=structured data bug" target="_blank"><?php _e( 'WooCommerce structured data markup bug','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>7. <a href="https://adtribes.io/wpml-support/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=wpml support" target="_blank"><?php _e( 'Enable WPML support','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>8. <a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=aelia support" target="_blank"><?php _e( 'Enable Aelia currency switcher support','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>9. <a href="https://adtribes.io/help-my-feed-processing-is-stuck/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=feed stuck" target="_blank"><?php _e( 'Help, my feed is stuck!','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>10. <a href="https://adtribes.io/help-i-have-none-or-less-products-in-my-product-feed-than-expected/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=too few products" target="_blank"><?php _e( 'Help, my feed has no or too few products!','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>11. <a href="https://adtribes.io/polylang-support-product-feeds/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=polylang support" target="_blank"><?php _e( 'How to use the Polylang feature', 'woo-product-feed-pro' );?></a></strong></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
/**
|
||||
* Change default footer text, asking to review our plugin
|
||||
**/
|
||||
function my_footer_text($default) {
|
||||
return 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">★★★★★</a> rating. Thanks in advance!';
|
||||
}
|
||||
add_filter('admin_footer_text', 'my_footer_text');
|
||||
|
||||
/**
|
||||
* Create notification object
|
||||
*/
|
||||
$notifications_obj = new WooSEA_Get_Admin_Notifications;
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '2', 'false' );
|
||||
|
||||
/**
|
||||
* Create product attribute object
|
||||
*/
|
||||
$attributes_obj = new WooSEA_Attributes;
|
||||
$attributes = $attributes_obj->get_product_attributes();
|
||||
|
||||
/**
|
||||
* Update or get project configuration
|
||||
*/
|
||||
if (array_key_exists('project_hash', $_GET)){
|
||||
$project = WooSEA_Update_Project::get_project_data(sanitize_text_field($_GET['project_hash']));
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_GET['channel_hash']));
|
||||
$manage_project = "yes";
|
||||
$standard_attributes = array();
|
||||
|
||||
foreach ($project['attributes'] as $k => $v){
|
||||
$value = $attributes[$k];
|
||||
$standard_attributes[$k] = $value;
|
||||
}
|
||||
} else {
|
||||
// Sanitize values in multi-dimensional POST array
|
||||
if(is_array($_POST)){
|
||||
foreach($_POST as $p_key => $p_value){
|
||||
if(is_array($p_value)){
|
||||
foreach($p_value as $pp_key => $pp_value){
|
||||
if(is_array($pp_value)){
|
||||
foreach($pp_value as $ppp_key => $ppp_value){
|
||||
$_POST[$p_key][$pp_key][$ppp_key] = sanitize_text_field($ppp_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_POST[$p_key] = sanitize_text_field($p_value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_POST = array();
|
||||
}
|
||||
|
||||
$project = WooSEA_Update_Project::update_project($_POST);
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_POST['channel_hash']));
|
||||
$standard_attributes = $attributes_obj->get_standard_attributes($project);
|
||||
|
||||
// Product variations will need to have the Item group ID attribute in the product feed
|
||||
if(isset($_POST['product_variations'])){
|
||||
$standard_attributes["item_group_id"] = "Item group ID (obliged)";
|
||||
}
|
||||
}
|
||||
$left_attributes = array_diff($attributes, $standard_attributes);
|
||||
|
||||
/**
|
||||
* Determine next step in configuration flow
|
||||
*/
|
||||
$step = 4;
|
||||
if($channel_data['taxonomy'] != "none"){
|
||||
$step = 1;
|
||||
}
|
||||
?>
|
||||
<div class="wrap">
|
||||
<div class="woo-product-feed-pro-form-style-2">
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tbody class="woo-product-feed-pro-body">
|
||||
<div class="woo-product-feed-pro-form-style-2-heading">Attribute picking</div>
|
||||
|
||||
<div class="<?php _e($notifications_box['message_type']); ?>">
|
||||
<p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
|
||||
</div>
|
||||
|
||||
<tr>
|
||||
<td><strong>All active attributes:</strong></td>
|
||||
<td><strong>Export these attributes to product feed:</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br/>
|
||||
<div class="woo-product-feed-pro-textarea">
|
||||
<ul id="woo-product-feed-pro-sortable1" class="connectedSortable">
|
||||
<?php
|
||||
foreach ($left_attributes as $key=>$value) {
|
||||
$display_value = ucfirst($value);
|
||||
print "<li class=\"ui-state-default\">$display_value <span style=\"float:right;\" class=\"ui-icon ui-icon-arrow-4\"></span><input type=\"hidden\" name=\"attributes[$key]\" value=\"true\"/></li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<br/></td>
|
||||
<td><br/>
|
||||
<form action="" method="post">
|
||||
<div class="woo-product-feed-pro-textarea">
|
||||
<ul id="woo-product-feed-pro-sortable2" class="connectedSortable">
|
||||
<?php
|
||||
foreach ($standard_attributes as $key=>$value) {
|
||||
$display_value = ucfirst($value);
|
||||
print "<li class=\"ui-state-default\">$display_value <span style=\"float:right;\" class=\"ui-icon ui-icon-arrow-4\"></span><input type=\"hidden\" name=\"attributes[$key]\" value=\"true\"/></li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<br/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="hidden" id="channel_hash" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
|
||||
<?php
|
||||
if(isset($manage_project)){
|
||||
?>
|
||||
<input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="step" value="100">
|
||||
<input type="submit" value="Save" />
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="step" value="<?php print "$step";?>">
|
||||
<input type="submit" value="Continue" />
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,424 @@
|
||||
<?php
|
||||
/**
|
||||
* Change default footer text, asking to review our plugin
|
||||
**/
|
||||
function my_footer_text($default) {
|
||||
return _e( 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">★★★★★</a> rating. Thanks in advance!','woo-product-feed-pro' );
|
||||
}
|
||||
add_filter('admin_footer_text', 'my_footer_text');
|
||||
|
||||
/**
|
||||
* Create notification object
|
||||
*/
|
||||
$notifications_obj = new WooSEA_Get_Admin_Notifications;
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '4', 'false' );
|
||||
|
||||
/**
|
||||
* Create product attribute object
|
||||
*/
|
||||
$attributes_obj = new WooSEA_Attributes;
|
||||
$attributes = $attributes_obj->get_product_attributes();
|
||||
|
||||
/**
|
||||
* Update or get project configuration
|
||||
*/
|
||||
$nonce = wp_create_nonce( 'woosea_ajax_nonce' );
|
||||
|
||||
/**
|
||||
* Update or get project configuration
|
||||
*/
|
||||
if (array_key_exists('project_hash', $_GET)){
|
||||
$project = WooSEA_Update_Project::get_project_data(sanitize_text_field($_GET['project_hash']));
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_GET['channel_hash']));
|
||||
$count_rules = 0;
|
||||
if(isset($project['rules'])){
|
||||
$count_rules = count($project['rules']);
|
||||
}
|
||||
|
||||
$count_rules2 = 0;
|
||||
if(isset($project['rules2'])){
|
||||
$count_rules2 = count($project['rules2']);
|
||||
}
|
||||
$manage_project = "yes";
|
||||
} else {
|
||||
// Sanitize values in multi-dimensional POST array
|
||||
if(is_array($_POST)){
|
||||
foreach($_POST as $p_key => $p_value){
|
||||
if(is_array($p_value)){
|
||||
foreach($p_value as $pp_key => $pp_value){
|
||||
if(is_array($pp_value)){
|
||||
foreach($pp_value as $ppp_key => $ppp_value){
|
||||
$_POST[$p_key][$pp_key][$ppp_key] = sanitize_text_field($ppp_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_POST[$p_key] = sanitize_text_field($p_value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_POST = array();
|
||||
}
|
||||
|
||||
$project = WooSEA_Update_Project::update_project($_POST);
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_POST['channel_hash']));
|
||||
$count_rules = 0;
|
||||
$count_rules2 = 0;
|
||||
}
|
||||
?>
|
||||
<div class="wrap">
|
||||
<div class="woo-product-feed-pro-form-style-2">
|
||||
<div class="woo-product-feed-pro-form-style-2-heading"><?php _e( 'Feed filters and rules','woo-product-feed-pro' );?></div>
|
||||
|
||||
<div class="<?php _e($notifications_box['message_type']); ?>">
|
||||
<p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
|
||||
</div>
|
||||
<form id="rulesandfilters" method="post">
|
||||
<input name="nonce_filters_mapping" id="nonce_filters_mapping" class="nonce_filters_mapping" value="<?php print "$nonce";?>" type="hidden">
|
||||
|
||||
<table class="woo-product-feed-pro-table" id="woosea-ajax-table" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><?php _e( 'Type','woo-product-feed-pro' );?></th>
|
||||
<th><?php _e( 'IF','woo-product-feed-pro' );?></th>
|
||||
<th><?php _e( 'Condition','woo-product-feed-pro' );?></th>
|
||||
<th><?php _e( 'Value','woo-product-feed-pro' );?></th>
|
||||
<th><?php _e( 'CS','woo-product-feed-pro' );?></th>
|
||||
<th><?php _e( 'Then','woo-product-feed-pro' );?></th>
|
||||
<th><?php _e( 'IS','woo-product-feed-pro' );?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<?php
|
||||
//if(isset($project['rules'])){
|
||||
print "<tbody class=\"woo-product-feed-pro-body\">";
|
||||
if(isset($project['rules'])){
|
||||
foreach ($project['rules'] as $rule_key => $rule_array){
|
||||
|
||||
if(isset($project['rules'][$rule_key]['criteria'])){
|
||||
$criteria = $project['rules'][$rule_key]['criteria'];
|
||||
} else {
|
||||
$criteria = "";
|
||||
}
|
||||
?>
|
||||
<tr class="rowCount">
|
||||
<td><input type="hidden" name="rules[<?php print "$rule_key";?>][rowCount]" value="<?php print "$rule_key";?>"><input type="checkbox" name="record" class="checkbox-field"></td>
|
||||
<td><i><?php _e( 'Filter','woo-product-feed-pro' );?></i></td>
|
||||
<td>
|
||||
<select name="rules[<?php print "$rule_key";?>][attribute]" class="select-field">
|
||||
<option></option>
|
||||
<?php
|
||||
foreach ($attributes as $k => $v){
|
||||
if (isset($project['rules'][$rule_key]['attribute']) AND ($project['rules'][$rule_key]['attribute'] == $k)){
|
||||
print "<option value=\"$k\" selected>$v</option>";
|
||||
} else {
|
||||
print "<option value=\"$k\">$v</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select name="rules[<?php print "$rule_key";?>][condition]" class="select-field">
|
||||
<?php
|
||||
if (isset($project['rules'][$rule_key]['condition']) AND ($project['rules'][$rule_key]['condition'] == "contains")){
|
||||
print "<option value=\"contains\" selected>contains</option>";
|
||||
} else {
|
||||
print "<option value=\"contains\">contains</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules'][$rule_key]['condition']) AND ($project['rules'][$rule_key]['condition'] == "containsnot")){
|
||||
print "<option value=\"containsnot\" selected>doesn't contain</option>";
|
||||
} else {
|
||||
print "<option value=\"containsnot\">doesn't contain</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules'][$rule_key]['condition']) AND ($project['rules'][$rule_key]['condition'] == "=")){
|
||||
print "<option value=\"=\" selected>is equal to</option>";
|
||||
} else {
|
||||
print "<option value=\"=\">is equal to</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules'][$rule_key]['condition']) AND ($project['rules'][$rule_key]['condition'] == "!=")){
|
||||
print "<option value=\"!=\" selected>is not equal to</option>";
|
||||
} else {
|
||||
print "<option value=\"!=\">is not equal to</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules'][$rule_key]['condition']) AND ($project['rules'][$rule_key]['condition'] == ">")){
|
||||
print "<option value=\">\" selected>is greater than</option>";
|
||||
} else {
|
||||
print "<option value=\">\">is greater than</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules'][$rule_key]['condition']) AND ($project['rules'][$rule_key]['condition'] == ">=")){
|
||||
print "<option value=\">=\" selected>is greater or equal to</option>";
|
||||
} else {
|
||||
print "<option value=\">=\">is greater or equal to</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules'][$rule_key]['condition']) AND ($project['rules'][$rule_key]['condition'] == "<")){
|
||||
print "<option value=\"<\" selected>is less than</option>";
|
||||
} else {
|
||||
print "<option value=\"<\">is less than</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules'][$rule_key]['condition']) AND ($project['rules'][$rule_key]['condition'] == "=<")){
|
||||
print "<option value=\"=<\" selected>is less or equal to</option>";
|
||||
} else {
|
||||
print "<option value=\"=<\">is less or equal to</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules'][$rule_key]['condition']) AND ($project['rules'][$rule_key]['condition'] == "empty")){
|
||||
print "<option value=\"empty\" selected>is empty</option>";
|
||||
} else {
|
||||
print "<option value=\"empty\">is empty</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules'][$rule_key]['condition']) AND ($project['rules'][$rule_key]['condition'] == "notempty")){
|
||||
print "<option value=\"notempty\" selected>is not empty</option>";
|
||||
} else {
|
||||
print "<option value=\"notempty\">is not empty</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<div style="display: block;">
|
||||
<input type="text" id="rulevalue" name="rules[<?php print "$rule_key";?>][criteria]" class="input-field-large" value='<?php print $criteria;?>'>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if (isset($project['rules'][$rule_key]['cs'])){
|
||||
print "<input type=\"checkbox\" name=\"rules[$rule_key][cs]\" class=\"checkbox-field\" alt=\"Case sensitive\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" name=\"rules[$rule_key][cs]\" class=\"checkbox-field\" alt=\"Case sensitive\">";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<select name="rules[<?php print "$rule_key";?>][than]" class="select-field">
|
||||
<optgroup label='Action'>Action:
|
||||
<?php
|
||||
if (isset($project['rules'][$rule_key]['than']) AND ($project['rules'][$rule_key]['than'] == "exclude")){
|
||||
print "<option value=\"exclude\" selected> Exclude</option>";
|
||||
} else {
|
||||
print "<option value=\"exclude\"> Exclude</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules'][$rule_key]['than']) AND ($project['rules'][$rule_key]['than'] == "include_only")){
|
||||
print "<option value=\"include_only\" selected> Include only</option>";
|
||||
} else {
|
||||
print "<option value=\"include_only\"> Include only</option>";
|
||||
}
|
||||
?>
|
||||
</optgroup>
|
||||
</select>
|
||||
</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
// RULES SECTION
|
||||
|
||||
if (isset($project['rules2'])){
|
||||
|
||||
foreach($project['rules2'] as $rule2_key => $rule2_array){
|
||||
|
||||
if(isset($project['rules2'][$rule2_key]['criteria'])){
|
||||
$criteria = $project['rules2'][$rule2_key]['criteria'];
|
||||
} else {
|
||||
$criteria = "";
|
||||
}
|
||||
if(isset($project['rules2'][$rule2_key]['newvalue'])){
|
||||
$newvalue = $project['rules2'][$rule2_key]['newvalue'];
|
||||
} else {
|
||||
$newvalue = "";
|
||||
}
|
||||
?>
|
||||
<tr class="rowCount">
|
||||
<td><input type="hidden" name="rules2[<?php print "$rule2_key";?>][rowCount]" value="<?php print "$rule2_key";?>"><input type="checkbox" name="record" class="checkbox-field"></td>
|
||||
<td><i><?php _e( 'Rule','woo-product-feed-pro' );?></i></td>
|
||||
<td>
|
||||
<select name="rules2[<?php print "$rule2_key";?>][attribute]" class="select-field">
|
||||
<option></option>
|
||||
<?php
|
||||
foreach ($attributes as $k => $v){
|
||||
if (isset($project['rules2'][$rule2_key]['attribute']) AND ($project['rules2'][$rule2_key]['attribute'] == $k)){
|
||||
print "<option value=\"$k\" selected>$v</option>";
|
||||
} else {
|
||||
print "<option value=\"$k\">$v</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<select name="rules2[<?php print "$rule2_key";?>][condition]" class="select-field">
|
||||
<?php
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "contains")){
|
||||
print "<option value=\"contains\" selected>contains</option>";
|
||||
} else {
|
||||
print "<option value=\"contains\">contains</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "containsnot")){
|
||||
print "<option value=\"containsnot\" selected>doesn't contain</option>";
|
||||
} else {
|
||||
print "<option value=\"containsnot\">doesn't contain</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "=")){
|
||||
print "<option value=\"=\" selected>is equal to</option>";
|
||||
} else {
|
||||
print "<option value=\"=\">is equal to</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "!=")){
|
||||
print "<option value=\"!=\" selected>is not equal to</option>";
|
||||
} else {
|
||||
print "<option value=\"!=\">is not equal to</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == ">")){
|
||||
print "<option value=\">\" selected>is greater than</option>";
|
||||
} else {
|
||||
print "<option value=\">\">is greater than</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == ">=")){
|
||||
print "<option value=\">=\" selected>is greater or equal to</option>";
|
||||
} else {
|
||||
print "<option value=\">=\">is greater or equal to</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "<")){
|
||||
print "<option value=\"<\" selected>is less than</option>";
|
||||
} else {
|
||||
print "<option value=\"<\">is less than</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "=<")){
|
||||
print "<option value=\"=<\" selected>is less or equal to</option>";
|
||||
} else {
|
||||
print "<option value=\"=<\">is less or equal to</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "empty")){
|
||||
print "<option value=\"empty\" selected>is empty</option>";
|
||||
} else {
|
||||
print "<option value=\"empty\">is empty</option>";
|
||||
}
|
||||
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "notempty")){
|
||||
print "<option value=\"notempty\" selected>is not empty</option>";
|
||||
} else {
|
||||
print "<option value=\"notempty\">is not empty</option>";
|
||||
}
|
||||
|
||||
// Data manipulators
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "multiply")){
|
||||
print "<option value=\"multiply\" selected>multiply</option>";
|
||||
} else {
|
||||
print "<option value=\"multiply\">multiply</option>";
|
||||
}
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "divide")){
|
||||
print "<option value=\"divide\" selected>divide</option>";
|
||||
} else {
|
||||
print "<option value=\"divide\">divide</option>";
|
||||
}
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "plus")){
|
||||
print "<option value=\"plus\" selected>plus</option>";
|
||||
} else {
|
||||
print "<option value=\"plus\">plus</option>";
|
||||
}
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "minus")){
|
||||
print "<option value=\"minus\" selected>minus</option>";
|
||||
} else {
|
||||
print "<option value=\"minus\">minus</option>";
|
||||
}
|
||||
if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "findreplace")){
|
||||
print "<option value=\"findreplace\" selected>find and replace</option>";
|
||||
} else {
|
||||
print "<option value=\"findreplace\">find and replace</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<div style="display: block;">
|
||||
<input type="text" id="rulevalue" name="rules2[<?php print "$rule2_key";?>][criteria]" class="input-field-large" value='<?php print $criteria;?>'>
|
||||
</div>
|
||||
</td>
|
||||
<?php
|
||||
$manipulators = array('multiply','divide','plus','minus');
|
||||
if (in_array($project['rules2'][$rule2_key]['condition'], $manipulators,TRUE)){
|
||||
print "<td colspan=3></td>";
|
||||
} else {
|
||||
?>
|
||||
<td>
|
||||
<?php
|
||||
if (isset($project['rules2'][$rule2_key]['cs'])){
|
||||
print "<input type=\"checkbox\" name=\"rules2[$rule2_key][cs]\" class=\"checkbox-field\" alt=\"Case sensitive\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" name=\"rules2[$rule2_key][cs]\" class=\"checkbox-field\" alt=\"Case sensitive\">";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<select name="rules2[<?php print "$rule2_key";?>][than_attribute]" class="select-field" style="width:150px;">
|
||||
<option></option>
|
||||
<?php
|
||||
foreach ($attributes as $k => $v){
|
||||
if (isset($project['rules2'][$rule2_key]['than_attribute']) AND ($project['rules2'][$rule2_key]['than_attribute'] == $k)){
|
||||
print "<option value=\"$k\" selected>$v</option>";
|
||||
} else {
|
||||
print "<option value=\"$k\">$v</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td><input type="text" name="rules2[<?php print "$rule2_key";?>][newvalue]" class="input-field-large" value="<?php print "$newvalue";?>"></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
print "</tbody>";
|
||||
//}
|
||||
?>
|
||||
<tbody>
|
||||
<tr class="rules-buttons">
|
||||
<td colspan="8">
|
||||
|
||||
<input type="hidden" id="channel_hash" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
|
||||
<?php
|
||||
if(isset($manage_project)){
|
||||
?>
|
||||
<input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="woosea_page" value="filters_rules">
|
||||
<input type="hidden" name="step" value="100">
|
||||
<input type="button" class="delete-row" value="- Delete"> <input type="button" class="add-filter" value="+ Add filter"> <input type="button" class="add-rule" value="+ Add rule"> <input type="submit" id="savebutton" value="Save">
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="step" value="5">
|
||||
<input type="button" class="delete-row" value="- Delete"> <input type="button" class="add-filter" value="+ Add filter"> <input type="button" class="add-rule" value="+ Add rule"> <input type="submit" id="savebutton" value="Continue">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
/**
|
||||
* Change default footer text, asking to review our plugin
|
||||
**/
|
||||
function my_footer_text($default) {
|
||||
return _e( 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">★★★★★</a> rating. Thanks in advance!','woo-product-feed-pro' );
|
||||
}
|
||||
add_filter('admin_footer_text', 'my_footer_text');
|
||||
|
||||
$error = "false";
|
||||
/**
|
||||
* Create notification object
|
||||
*/
|
||||
$notifications_obj = new WooSEA_Get_Admin_Notifications;
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '5', $error );
|
||||
|
||||
/**
|
||||
* Create product attribute object
|
||||
*/
|
||||
$attributes_obj = new WooSEA_Attributes;
|
||||
$attributes = $attributes_obj->get_product_attributes();
|
||||
|
||||
/**
|
||||
* Update or get project configuration
|
||||
*/
|
||||
$nonce = wp_create_nonce( 'woosea_ajax_nonce' );
|
||||
|
||||
/**
|
||||
* Get some channel configs for default utm_source
|
||||
* Update project configuration
|
||||
*/
|
||||
if (array_key_exists('project_hash', $_GET)){
|
||||
$project = WooSEA_Update_Project::get_project_data(sanitize_text_field($_GET['project_hash']));
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_GET['channel_hash']));
|
||||
$manage_project = "yes";
|
||||
} else {
|
||||
// Sanitize values in multi-dimensional POST array
|
||||
if(is_array($_POST)){
|
||||
foreach($_POST as $p_key => $p_value){
|
||||
if(is_array($p_value)){
|
||||
foreach($p_value as $pp_key => $pp_value){
|
||||
if(is_array($pp_value)){
|
||||
foreach($pp_value as $ppp_key => $ppp_value){
|
||||
$_POST[$p_key][$pp_key][$ppp_key] = sanitize_text_field($ppp_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_POST[$p_key] = sanitize_text_field($p_value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_POST = array();
|
||||
}
|
||||
$project = WooSEA_Update_Project::update_project($_POST);
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_POST['channel_hash']));
|
||||
$project['utm_source'] = $project['name'];
|
||||
$project['utm_medium'] = "cpc";
|
||||
$project['utm_campaign'] = $project['projectname'];
|
||||
$project['utm_term'] = "";
|
||||
$project['utm_content'] = "";
|
||||
$project['utm_on'] = "on";
|
||||
$project['adtribes_conversion'] = "on";
|
||||
$project['total_product_orders_lookback'] = "";
|
||||
}
|
||||
?>
|
||||
<div class="wrap">
|
||||
<div class="woo-product-feed-pro-form-style-2">
|
||||
<tbody class="woo-product-feed-pro-body">
|
||||
<div class="woo-product-feed-pro-form-style-2-heading"><?php _e( 'Conversion & Google Analytics settings','woo-product-feed-pro' );?></div>
|
||||
|
||||
<div class="<?php _e($notifications_box['message_type']); ?>">
|
||||
<p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
|
||||
</div>
|
||||
|
||||
<form id="googleanalytics" method="post">
|
||||
<input name="nonce_google_mapping" id="nonce_google_mapping" class="nonce_google_mapping" value="<?php print "$nonce";?>" type="hidden">
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<!--
|
||||
<tr>
|
||||
<td><span>Enable conversion tracking: </span></td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
if(isset($project['adtribes_conversion'])){
|
||||
print "<input type=\"checkbox\" name=\"adtribes_conversion\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" name=\"adtribes_conversion\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
-->
|
||||
<tr>
|
||||
<td><span><?php _e( 'Enable Google Analytics tracking','woo-product-feed-pro' );?>: </span></td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
if(isset($project['utm_on'])){
|
||||
print "<input type=\"checkbox\" name=\"utm_on\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" name=\"utm_on\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span><?php _e( 'Google Analytics campaign source (utm_source)','woo-product-feed-pro' );?>:</span></td>
|
||||
<td><input type="text" class="input-field" name="utm_source" value="<?php print "$project[utm_source]";?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span><?php _e( 'Google Analytics campaign medium (utm_medium)','woo-product-feed-pro' );?>:</span></td>
|
||||
<td><input type="text" class="input-field" name="utm_medium" value="<?php print "$project[utm_medium]";?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span><?php _e( 'Google Analytics campaign name (utm_campaign)','woo-product-feed-pro' );?>:</span></td>
|
||||
<td><input type="text" class="input-field" name="utm_campaign" value="<?php print "$project[utm_campaign]";?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span><?php _e( 'Google Analytics campaign term (utm_term)','woo-product-feed-pro' );?>:</span></td>
|
||||
<td><input type="hidden" name="utm_term" value="id"><input type="text" class="input-field" value="[productId]" disabled/> <i>(<?php _e('dynamically added Product ID','woo-product-feed-pro' );?>)</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span><?php _e( 'Google Analytics campaign content (utm_content)','woo-product-feed-pro' );?>:</span></td>
|
||||
<td><input type="text" class="input-field" name="utm_content" value="<?php print "$project[utm_content]";?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span><?php _e( 'Remove products that did not have sales in the last days','woo-product-feed-pro' );?>: <a href="https://adtribes.io/create-feed-performing-products/" target="_blank">What does this do?</a></span></td>
|
||||
<td><input type="text" class="input-field" name="total_product_orders_lookback" value="<?php print "$project[total_product_orders_lookback]";?>" /> days</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?php
|
||||
if(isset($manage_project)){
|
||||
?>
|
||||
<input type="hidden" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
|
||||
<input type="hidden" name="project_update" id="project_update" value="yes">
|
||||
<input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="step" value="100">
|
||||
<input type="hidden" name="woosea_page" value="analytics">
|
||||
<input type="submit" id="savebutton" value="Save">
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<input type="hidden" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
|
||||
<input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="step" value="101">
|
||||
<input type="hidden" name="woosea_page" value="analytics">
|
||||
<input type="submit" id="savebutton" value="Generate Product Feed">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</tbody>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,294 @@
|
||||
<?php
|
||||
/**
|
||||
* Change default footer text, asking to review our plugin
|
||||
**/
|
||||
function my_footer_text($default) {
|
||||
return _e( 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">★★★★★</a> rating. Thanks in advance!','woo-product-feed-pro' );
|
||||
}
|
||||
add_filter('admin_footer_text', 'my_footer_text');
|
||||
|
||||
/**
|
||||
* Create notification object
|
||||
*/
|
||||
$notifications_obj = new WooSEA_Get_Admin_Notifications;
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '7', 'false' );
|
||||
|
||||
/**
|
||||
* Create product attribute object
|
||||
**/
|
||||
$attributes_obj = new WooSEA_Attributes;
|
||||
$attribute_dropdown = $attributes_obj->get_product_attributes();
|
||||
|
||||
/**
|
||||
* Update or get project configuration
|
||||
*/
|
||||
$nonce = wp_create_nonce( 'woosea_ajax_nonce' );
|
||||
|
||||
/**
|
||||
* Update or get project configuration
|
||||
*/
|
||||
if (array_key_exists('project_hash', $_GET)){
|
||||
$project = WooSEA_Update_Project::get_project_data(sanitize_text_field($_GET['project_hash']));
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_GET['channel_hash']));
|
||||
$count_mappings = count($project['attributes']);
|
||||
$manage_project = "yes";
|
||||
|
||||
if(isset($project['WPML'])){
|
||||
if ( ( is_plugin_active('sitepress-multilingual-cms') ) OR ( function_exists('icl_object_id') ) ){
|
||||
if( !class_exists( 'Polylang' ) ) {
|
||||
// Get WPML language
|
||||
global $sitepress;
|
||||
$lang = $project['WPML'];
|
||||
$sitepress->switch_lang($lang);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Sanitize values in multi-dimensional POST array
|
||||
if(is_array($_POST)){
|
||||
foreach($_POST as $p_key => $p_value){
|
||||
if(is_array($p_value)){
|
||||
foreach($p_value as $pp_key => $pp_value){
|
||||
if(is_array($pp_value)){
|
||||
foreach($pp_value as $ppp_key => $ppp_value){
|
||||
$_POST[$p_key][$pp_key][$ppp_key] = sanitize_text_field($ppp_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_POST[$p_key] = sanitize_text_field($p_value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_POST = array();
|
||||
}
|
||||
$project = WooSEA_Update_Project::update_project($_POST);
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_POST['channel_hash']));
|
||||
|
||||
if(isset($project['WPML'])){
|
||||
if ( ( is_plugin_active('sitepress-multilingual-cms') ) OR ( function_exists('icl_object_id') ) ){
|
||||
if( !class_exists( 'Polylang' ) ) {
|
||||
// Get WPML language
|
||||
global $sitepress;
|
||||
$lang = $project['WPML'];
|
||||
$sitepress->switch_lang($lang);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine next step in configuration flow
|
||||
**/
|
||||
$step = 4;
|
||||
if($channel_data['taxonomy'] != "none"){
|
||||
$step = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get main currency
|
||||
**/
|
||||
$currency = get_woocommerce_currency();
|
||||
if(isset($project['WCML'])){
|
||||
$currency = $project['WCML'];
|
||||
}
|
||||
|
||||
if(isset($project['AELIA'])){
|
||||
$currency = $project['AELIA'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Create channel attribute object
|
||||
**/
|
||||
require plugin_dir_path(__FILE__) . '../../classes/channels/class-'.$channel_data['fields'].'.php';
|
||||
$obj = "WooSEA_".$channel_data['fields'];
|
||||
$fields_obj = new $obj;
|
||||
$attributes = $fields_obj->get_channel_attributes();
|
||||
?>
|
||||
<div id="dialog" title="Basic dialog">
|
||||
<p>
|
||||
<div id="dialogText"></div>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="wrap">
|
||||
<div class="woo-product-feed-pro-form-style-2">
|
||||
<div class="woo-product-feed-pro-form-style-2-heading"><?php _e( 'Field mapping','woo-product-feed-pro' );?></div>
|
||||
|
||||
<div class="<?php _e($notifications_box['message_type']); ?>">
|
||||
<p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
|
||||
</div>
|
||||
|
||||
<form action="" id="fieldmapping" method="post">
|
||||
<input name="nonce_field_mapping" id="nonce_field_mapping" class="nonce_field_mapping" value="<?php print "$nonce";?>" type="hidden">
|
||||
<table class="woo-product-feed-pro-table" id="woosea-fieldmapping-table" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>
|
||||
<?php
|
||||
print "$channel_data[name] attributes";
|
||||
?>
|
||||
</th>
|
||||
<th><?php _e( 'Prefix','woo-product-feed-pro' );?></th>
|
||||
<th><?php _e( 'Value','woo-product-feed-pro' );?></th>
|
||||
<th><?php _e( 'Suffix','woo-product-feed-pro' );?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="woo-product-feed-pro-body">
|
||||
<?php
|
||||
if (!isset($count_mappings)){
|
||||
$c = 0;
|
||||
foreach($attributes as $row_key => $row_value){
|
||||
foreach($row_value as $row_k => $row_v){
|
||||
if ($row_v['format'] == "required"){
|
||||
?>
|
||||
<tr class="rowCount <?php print"$c";?>">
|
||||
<td><input type="hidden" name="attributes[<?php print "$c";?>][rowCount]" value="<?php print "$c";?>">
|
||||
<input type="checkbox" name="record" class="checkbox-field">
|
||||
</td>
|
||||
<td>
|
||||
<select name="attributes[<?php print"$c"; ?>][attribute]" class="select-field">
|
||||
<?php
|
||||
foreach($attributes as $key => $value) {
|
||||
print "<optgroup label='$key'><strong>$key</strong>";
|
||||
|
||||
foreach($value as $k => $v){
|
||||
if($v['feed_name'] == $row_v['feed_name']){
|
||||
if (array_key_exists('name',$v)){
|
||||
$dialog_value = $v['feed_name'];
|
||||
print "<option value='$v[feed_name]' selected>$k ($v[name])</option>";
|
||||
} else {
|
||||
print "<option value='$v[feed_name]' selected>$k</option>";
|
||||
}
|
||||
} else {
|
||||
if (array_key_exists('name',$v)){
|
||||
print "<option value='$v[feed_name]'>$k ($v[name])</option>";
|
||||
} else {
|
||||
print "<option value='$v[feed_name]'>$k</option>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if($row_v['feed_name'] == "g:price"){
|
||||
print "<input type='text' name='attributes[$c][prefix]' value='$currency' class='input-field-medium'>";
|
||||
} else {
|
||||
print "<input type='text' name='attributes[$c][prefix]' class='input-field-medium'>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<select name="attributes[<?php print "$c";?>][mapfrom]" class="select-field">
|
||||
<option></option>
|
||||
<?php
|
||||
foreach($attribute_dropdown as $drop_key => $drop_value){
|
||||
if(array_key_exists("woo_suggest", $row_v) ){
|
||||
if($row_v['woo_suggest'] == $drop_key){
|
||||
print "<option value='$drop_key' selected>$drop_value</option>";
|
||||
} else {
|
||||
print "<option value='$drop_key'>$drop_value</option>";
|
||||
}
|
||||
} else {
|
||||
print "<option value='$drop_key'>$drop_value</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="attributes[<?php print "$c";?>][suffix]" class="input-field-medium">
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$c++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($project['attributes'] as $attribute_key => $attribute_array){
|
||||
if(isset($project['attributes'][$attribute_key]['prefix'])){
|
||||
$prefix = $project['attributes'][$attribute_key]['prefix'];
|
||||
}
|
||||
if(isset($project['attributes'][$attribute_key]['suffix'])){
|
||||
$suffix = $project['attributes'][$attribute_key]['suffix'];
|
||||
}
|
||||
?>
|
||||
<tr class="rowCount <?php print "$attribute_key";?>">
|
||||
<td><input type="hidden" name="attributes[<?php print "$attribute_key";?>][rowCount]" value="<?php print "$attribute_key";?>">
|
||||
<input type="checkbox" name="record" class="checkbox-field">
|
||||
</td>
|
||||
<td>
|
||||
<select name="attributes[<?php print"$attribute_key"; ?>][attribute]" class="select-field">
|
||||
<?php
|
||||
print "<option value=\"$attribute_array[attribute]\">$attribute_array[attribute]</option>";
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="attributes[<?php print "$attribute_key";?>][prefix]" class="input-field-medium" value="<?php print "$prefix";?>">
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<?php
|
||||
if(array_key_exists('static_value', $attribute_array)){
|
||||
print "<input type=\"text\" name=\"attributes[$attribute_key][mapfrom]\" class=\"input-field-midsmall\" value=\"$attribute_array[mapfrom]\"><input type=\"hidden\" name=\"attributes[$attribute_key][static_value]\" value=\"true\">";
|
||||
} else {
|
||||
?>
|
||||
<select name="attributes[<?php print "$attribute_key";?>][mapfrom]" class="select-field">
|
||||
<option></option>
|
||||
<?php
|
||||
foreach($attribute_dropdown as $drop_key => $drop_value){
|
||||
if($project['attributes'][$attribute_key]['mapfrom'] == $drop_key){
|
||||
print "<option value='$drop_key' selected>$drop_value</option>";
|
||||
} else {
|
||||
print "<option value='$drop_key'>$drop_value</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php }
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="attributes[<?php print "$attribute_key";?>][suffix]" class="input-field-medium" value="<?php print "$suffix";?>">
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<input type="hidden" id="channel_hash" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
|
||||
<?php
|
||||
if(isset($manage_project)){
|
||||
?>
|
||||
<input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="step" value="100">
|
||||
<input type="hidden" name="addrow" id="addrow" value="1">
|
||||
<input type="button" class="delete-field-mapping" value="- Delete"> <input type="button" class="add-field-mapping" value="+ Add field mapping"> <input type="button" class="add-own-mapping" value="+ Add custom field"> <input type="submit" id="savebutton" value="Save" />
|
||||
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="step" value="<?php print "$step";?>">
|
||||
<input type="hidden" name="addrow" id="addrow" value="1">
|
||||
<input type="button" class="delete-field-mapping" value="- Delete"> <input type="button" class="add-field-mapping" value="+ Add field mapping"> <input type="button" class="add-own-mapping" value="+ Add custom field"> <input type="submit" id="savebutton" value="Save" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
/**
|
||||
* Change default footer text, asking to review our plugin
|
||||
**/
|
||||
function my_footer_text($default) {
|
||||
return _e( 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">★★★★★</a> rating. Thanks in advance!','woo-product-feed-pro' );
|
||||
}
|
||||
add_filter('admin_footer_text', 'my_footer_text');
|
||||
$add_manipulation_support = get_option ('add_manipulation_support');
|
||||
$host = sanitize_text_field($_SERVER['HTTP_HOST']);
|
||||
|
||||
/**
|
||||
* Create notification object
|
||||
*/
|
||||
$notifications_obj = new WooSEA_Get_Admin_Notifications;
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '15', 'false' );
|
||||
|
||||
/**
|
||||
* Create product attribute object
|
||||
*/
|
||||
$attributes_obj = new WooSEA_Attributes;
|
||||
$attributes = $attributes_obj->get_product_attributes();
|
||||
|
||||
/**
|
||||
* Update or get project configuration
|
||||
*/
|
||||
$nonce = wp_create_nonce( 'woosea_ajax_nonce' );
|
||||
|
||||
/**
|
||||
* Update or get project configuration
|
||||
*/
|
||||
if (array_key_exists('project_hash', $_GET)){
|
||||
$project = WooSEA_Update_Project::get_project_data(sanitize_text_field($_GET['project_hash']));
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_GET['channel_hash']));
|
||||
$count_rules = 0;
|
||||
if(isset($project['field_manipulation'])){
|
||||
$count_rules = count($project['field_manipulation']);
|
||||
}
|
||||
$manage_project = "yes";
|
||||
} else {
|
||||
// Sanitize values in multi-dimensional POST array
|
||||
if(is_array($_POST)){
|
||||
foreach($_POST as $p_key => $p_value){
|
||||
if(is_array($p_value)){
|
||||
foreach($p_value as $pp_key => $pp_value){
|
||||
if(is_array($pp_value)){
|
||||
foreach($pp_value as $ppp_key => $ppp_value){
|
||||
$_POST[$p_key][$pp_key][$ppp_key] = sanitize_text_field($ppp_value);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_POST[$p_key] = sanitize_text_field($p_value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_POST = array();
|
||||
}
|
||||
$project = WooSEA_Update_Project::update_project(sanitize_text_field($_POST));
|
||||
$channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_POST['channel_hash']));
|
||||
$count_rules = 0;
|
||||
}
|
||||
?>
|
||||
<div class="wrap">
|
||||
<div class="woo-product-feed-pro-form-style-2">
|
||||
<div class="woo-product-feed-pro-form-style-2-heading"><?php _e( 'Product data manipulation','woo-product-feed-pro' );?></div>
|
||||
|
||||
<div class="<?php _e($notifications_box['message_type']); ?>">
|
||||
<p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
|
||||
</div>
|
||||
<form id="fieldmanipulation" method="post">
|
||||
<input name="nonce_manipulation_mapping" id="nonce_manipulation_mapping" class="nonce_manipulation_mapping" value="<?php print "$nonce";?>" type="hidden">
|
||||
|
||||
<table class="woo-product-feed-pro-table" id="woosea-ajax-table" border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th><?php _e( 'Product type','woo-product-feed-pro' );?></th>
|
||||
<th><?php _e( 'Field','woo-product-feed-pro' );?></th>
|
||||
<th><?php _e( 'Becomes','woo-product-feed-pro' );?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="woo-product-feed-pro-body">
|
||||
<?php
|
||||
if(isset($project['field_manipulation'])){
|
||||
|
||||
$product_types = array(
|
||||
"all" => "Simple and variable",
|
||||
"simple" => "Simple",
|
||||
"variable" => "Variable"
|
||||
);
|
||||
|
||||
foreach ($project['field_manipulation'] as $manipulation_key => $manipulation_array){
|
||||
?>
|
||||
<tr class="rowCount">
|
||||
<td valign="top">
|
||||
<input type="hidden" name="field_manipulation[<?php print "$manipulation_key";?>][rowCount]" value="<?php print "$manipulation_key";?>"><input type="checkbox" name="record" class="checkbox-field">
|
||||
</td>
|
||||
<td valign="top">
|
||||
<select name="field_manipulation[<?php print "$manipulation_key";?>][product_type]" class="select-field">
|
||||
<?php
|
||||
foreach ($product_types as $k => $v){
|
||||
if (isset($project['field_manipulation'][$manipulation_key]['product_type']) AND ($project['field_manipulation'][$manipulation_key]['product_type'] == $k)){
|
||||
print "<option value=\"$k\" selected>$v</option>";
|
||||
} else {
|
||||
print "<option value=\"$k\">$v</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<select name="field_manipulation[<?php print "$manipulation_key";?>][attribute]" class="select-field">
|
||||
<?php
|
||||
foreach ($attributes as $k => $v){
|
||||
if (isset($project['field_manipulation'][$manipulation_key]['attribute']) AND ($project['field_manipulation'][$manipulation_key]['attribute'] == $k)){
|
||||
print "<option value=\"$k\" selected>$v</option>";
|
||||
} else {
|
||||
print "<option value=\"$k\">$v</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td valign="top" class="becomes_fields_<?php print "$manipulation_key";?>">
|
||||
<?php
|
||||
foreach ($project['field_manipulation'][$manipulation_key]['becomes'] as $k => $v){
|
||||
print "<select name=\"field_manipulation[$manipulation_key][becomes][$k][attribute]\" class=\"select_field\">";
|
||||
foreach ($attributes as $ak => $av){
|
||||
if (isset($project['field_manipulation'][$manipulation_key]['becomes'][$k]['attribute']) AND ($project['field_manipulation'][$manipulation_key]['becomes'][$k]['attribute'] == $ak)){
|
||||
print "<option value=\"$ak\" selected>$av</option>";
|
||||
} else {
|
||||
print "<option value=\"$ak\">$av</option>";
|
||||
}
|
||||
}
|
||||
print "</select>";
|
||||
print "</br>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<span class="dashicons dashicons-plus field_extra field_manipulation_extra_<?php print"$manipulation_key";?>" style="display: inline-block;" title="Add an attribute to this field"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<tbody>
|
||||
|
||||
<tr class="rules-buttons">
|
||||
<td colspan="8">
|
||||
<input type="hidden" id="channel_hash" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
|
||||
<input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
|
||||
<input type="hidden" name="woosea_page" value="field_manipulation">
|
||||
<input type="hidden" name="step" value="100">
|
||||
<input type="button" class="delete-row" value="- Delete"> <input type="button" class="add-field-manipulation" value="+ Add field manipulation"> <input type="submit" id="savebutton" value="Save">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
$plugin_settings = get_option( 'plugin_settings' );
|
||||
$license_information = get_option( 'license_information' );
|
||||
|
||||
print "<pre>";
|
||||
print_r($license_information, TRUE);
|
||||
print "</pre>";
|
||||
|
||||
|
||||
$domain = $_SERVER['HTTP_HOST'];
|
||||
$error = "false";
|
||||
$plugin_data = get_plugin_data( __FILE__ );
|
||||
|
||||
$versions = array (
|
||||
"PHP" => (float)phpversion(),
|
||||
"Wordpress" => get_bloginfo('version'),
|
||||
"WooCommerce" => WC()->version,
|
||||
"WooCommerce Product Feed PRO" => WOOCOMMERCESEA_PLUGIN_VERSION
|
||||
);
|
||||
|
||||
// When license has not been checked yet
|
||||
if(empty($license_information['message'])){
|
||||
$license_information['message'] = "You did not purchase a license for our Elite features yet. The structured data fix feature and adding of extra Google Shopping fields to your store can be enabled if you upgrade. Please purchase a license key on <a href=\"https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite\" target=\"_blank\">AdTribes.io</a> when you would like to use the Elite features.";
|
||||
$license_information['message_type'] = "notice notice-info is-dismissible";
|
||||
$license_information['license_key'] = "";
|
||||
$license_information['license_email'] = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Create notification object and get message and message type as WooCommerce is inactive
|
||||
* also set variable allowed on 0 to disable submit button on step 1 of configuration
|
||||
*/
|
||||
$notifications_obj = new WooSEA_Get_Admin_Notifications;
|
||||
if (!in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '9', 'false' );
|
||||
} else {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '14', 'false' );
|
||||
}
|
||||
|
||||
if ($versions['PHP'] < 5.6){
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '11', 'false' );
|
||||
}
|
||||
|
||||
if ($versions['WooCommerce'] < 3){
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '13', 'false' );
|
||||
}
|
||||
|
||||
if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '12', 'false' );
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="dialog" title="Basic dialog">
|
||||
<p>
|
||||
<div id="dialogText"></div>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="wrap">
|
||||
<div class="woo-product-feed-pro-form-style-2">
|
||||
<tbody class="woo-product-feed-pro-body">
|
||||
<div class="woo-product-feed-pro-form-style-2-heading">Upgrade to Elite</div>
|
||||
<div class="<?php _e($license_information['message_type']); ?>">
|
||||
<p><?php _e($license_information['message'], 'sample-text-domain' ); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="woo-product-feed-pro-table-wrapper">
|
||||
<div class="woo-product-feed-pro-table-left">
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td>
|
||||
<span>License e-mail:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input-field-large" id="license-email" name="license-email" value="<?php print "$license_information[license_email]";?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span>License key:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input-field-large" id="license-key" name="license-key" value="<?php print "$license_information[license_key]";?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><span class="ui-icon ui-icon-alert"></span> <i>Please note that we will automatically validate your license once a day.</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="submit" id="checklicense" value="Activate license">
|
||||
<input type="submit" id="deactivate_license" value="Deactivate license">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="woo-product-feed-pro-table-right">
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong>We’ve got you covered!</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Need assistance? Check out our:
|
||||
<ul>
|
||||
<li><strong><a href="https://adtribes.io/support/" target="_blank">Frequently Asked Questions</a></strong></li>
|
||||
<li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
|
||||
<li><strong><a href="https://adtribes.io/tutorials/" target="_blank">Tutorials</a></strong></li>
|
||||
</ul>
|
||||
Or just reach out to us at <strong><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/" target="_blank">the support forum</a></strong> and we'll make sure your product feeds will be up-and-running within no-time.
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong>Our latest tutorials</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li><strong>1. <a href="https://adtribes.io/adding-missing-custom-attributes/" target="_blank">Adding missing custom attributes</a></strong></li>
|
||||
<li><strong>2. <a href="https://adtribes.io/can-i-add-mother-products-to-my-feed-and-leave-out-the-variations/" target="_blank">Can I leave out mother products?</a></strong></li>
|
||||
<li><strong>3. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/" target="_blank">Adding GTIN, Brand, MPN and more</a></strong></li>
|
||||
<li><strong>4. <a href="https://adtribes.io/woocommerce-structured-data-bug/" target="_blank">WooCommerce structured data markup bug</a></strong></li>
|
||||
<li><strong>5. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/" target="_blank">How to create filters for your product feed</a></strong></li>
|
||||
<li><strong>6. <a href="https://adtribes.io/wpml-support/" target="_blank">Enable WPML support</a></strong></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</tbody>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,382 @@
|
||||
<?php
|
||||
$cron_projects = get_option( 'cron_projects' );
|
||||
$license_information = get_option( 'license_information' );
|
||||
$count_variation = wp_count_posts('product_variation');
|
||||
$count_single = wp_count_posts('product');
|
||||
$published_single = $count_single->publish;
|
||||
$published_variation = $count_variation->publish;
|
||||
$published_products = $published_single+$published_variation;
|
||||
$host = sanitize_text_field($_SERVER['HTTP_HOST']);
|
||||
$add_manipulation_support = get_option ('add_manipulation_support');
|
||||
|
||||
$product_numbers = array (
|
||||
"Single products" => $published_single,
|
||||
"Variation products" => $published_variation,
|
||||
"Total products" => $published_products
|
||||
);
|
||||
|
||||
$plugin_data = get_plugin_data( __FILE__ );
|
||||
|
||||
$versions = array (
|
||||
"PHP" => (float)phpversion(),
|
||||
"Wordpress" => get_bloginfo('version'),
|
||||
"WooCommerce" => WC()->version,
|
||||
"WooCommerce Product Feed PRO" => WOOCOMMERCESEA_PLUGIN_VERSION
|
||||
);
|
||||
|
||||
// Get the sales from created product feeds
|
||||
//global $wpdb;
|
||||
//$charset_collate = $wpdb->get_charset_collate();
|
||||
//$table_name = $wpdb->prefix . 'adtribes_my_conversions';
|
||||
//$order_rows = $wpdb->get_results("SELECT * FROM $table_name", ARRAY_A);
|
||||
$order_rows = "";
|
||||
|
||||
/**
|
||||
* Change default footer text, asking to review our plugin
|
||||
**/
|
||||
function my_footer_text($default) {
|
||||
return _e( 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">★★★★★</a> rating. Thanks in advance!','woo-product-feed-pro');
|
||||
}
|
||||
add_filter('admin_footer_text', 'my_footer_text');
|
||||
|
||||
/**
|
||||
* Create notification object and get message and message type as WooCommerce is inactive
|
||||
* also set variable allowed on 0 to disable submit button on step 1 of configuration
|
||||
*/
|
||||
$notifications_obj = new WooSEA_Get_Admin_Notifications;
|
||||
if (!in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( "9", "false" );
|
||||
} else {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '8', 'false' );
|
||||
}
|
||||
|
||||
if ($versions['PHP'] < 5.6){
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '11', 'false' );
|
||||
}
|
||||
|
||||
if ($versions['WooCommerce'] < 3){
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '13', 'false' );
|
||||
}
|
||||
|
||||
if(!empty($license_information)){
|
||||
if($license_information['notice'] == "true"){
|
||||
$notifications_box['message_type'] = $license_information['message_type'];
|
||||
$notifications_box['message'] = $license_information['message'];
|
||||
}
|
||||
}
|
||||
|
||||
if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '12', 'false' );
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="wrap">
|
||||
<div class="woo-product-feed-pro-form-style-2">
|
||||
<tbody class="woo-product-feed-pro-body">
|
||||
<?php
|
||||
if (array_key_exists('debug', $_GET)){
|
||||
|
||||
// KILL SWITCH, THIS WILL REMOVE ALL YOUR FEED PROJECTS
|
||||
// delete_option( 'cron_projects');
|
||||
|
||||
if(sanitize_text_field($_GET['debug']) == "true"){
|
||||
$external_debug_file = $notifications_obj->woosea_debug_informations ($versions, $product_numbers, $order_rows, $cron_projects);
|
||||
?>
|
||||
<div class="woo-product-feed-pro-form-style-2-heading"><?php _e( 'Debugging mode', 'woo-product-feed-pro' );?></div>
|
||||
<div class="notice notice-error is-dismissible">
|
||||
<p>
|
||||
<?php _e( 'Thank you for taking the time to help us find bugs in our plugin. It is greatly appreciated by us and your feedback will help all current and future users of this plugin. Could you please copy / paste the debug URL in the box below and send it to <a href="mailto:support@adtribes.io">support@adtribes.io</a> so we can analyse how your feed projects are configured and discover potential problems.','woo-product-feed-pro' );?><br/><br/>
|
||||
<?php
|
||||
print "<strong>Debug file:</strong><br/><a href=\"$external_debug_file\" target=\"_blank\">$external_debug_file</a>";
|
||||
?>
|
||||
</p>
|
||||
</div><br/>
|
||||
<?php
|
||||
}
|
||||
} elseif (array_key_exists('force-active', $_GET)){
|
||||
// Force active all feeds
|
||||
foreach($cron_projects as $key => $value){
|
||||
$cron_projects[$key]['active'] = "true";
|
||||
}
|
||||
update_option('cron_projects', $cron_projects,'no');
|
||||
} elseif (array_key_exists('force-clean', $_GET)){
|
||||
// Forcefully remove all feed and plugin configurations
|
||||
delete_option( 'cron_projects' );
|
||||
delete_option( 'channel_statics' );
|
||||
delete_option( 'woosea_getelite_notification' );
|
||||
delete_option( 'woosea_license_notification_closed' );
|
||||
wp_clear_scheduled_hook( 'woosea_cron_hook' );
|
||||
wp_clear_scheduled_hook( 'woosea_check_license' );
|
||||
} elseif (array_key_exists('force-deduplication', $_GET)){
|
||||
// Force deduplication
|
||||
foreach($cron_projects as $key => $value){
|
||||
$channel_hash = $cron_projects[$key]['channel_hash'];
|
||||
$channel_duplicates = "woosea_duplicates_".$channel_hash;
|
||||
delete_option($channel_duplicates);
|
||||
}
|
||||
} else {
|
||||
// Set default notification to show
|
||||
$getelite_notice = get_option('woosea_getelite_notification');
|
||||
if(empty($getelite_notice['show'])){
|
||||
$getelite_notice['show'] = "yes";
|
||||
$getelite_notice['timestamp'] = date( 'd-m-Y' );
|
||||
}
|
||||
|
||||
if($getelite_notice['show'] <> "no"){
|
||||
?>
|
||||
<div class="notice notice-info get_elite is-dismissible">
|
||||
<p>
|
||||
<strong><?php _e( 'Would you like to get more out of your product feeds? Upgrade to the Elite version of the plugin and you will get:', 'woo-product-feed-pro' );?></strong><br/></br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'Priority support - we will help you to get your product feed(s) up-and-running;', 'woo-product-feed-pro' );?><br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'GTIN, Brand, MPN, EAN, Condition and more fields for your product feeds', 'woo-product-feed-pro' );?> [<a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=adding%20fields" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'Enhanched structured data on your product pages: more products approved in your Google Merchant Center', 'woo-product-feed-pro' );?> [<a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=structured%20data%20bug" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'Advanced product data manipulation','woo-product-feed-pro' );?> [<a href="https://adtribes.io/feature-product-data-manipulation/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=product%20data%20manipulation" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'WPML support - including their currency switcher','woo-product-feed-pro' );?> [<a href="https://adtribes.io/wpml-support/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=wpml%20support" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'Aelia currency switcher support','woo-product-feed-pro' );?> [<a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=aelia%20support" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'Polylang support','woo-product-feed-pro' );?> [<a href="https://adtribes.io/polylang-support-product-feeds/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=polylang%20support" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/>
|
||||
<span class="dashicons dashicons-yes"></span><?php _e( 'Facebook pixel feature','woo-product-feed-pro' );?> [<a href="https://adtribes.io/facebook-pixel-feature/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=facebook pixel feature" target="_blank"><?php _e( 'Read more','woo-product-feed-pro' );?></a>];<br/><br/>
|
||||
<?php _e( 'Upgrade to the','woo-product-feed-pro' );?> <strong><a href="https://adtribes.io/pro-vs-elite/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=top-notification&utm_content=notification" target="_blank"><?php _e( 'Elite version of our plugin</a></strong> to get all these features.','woo-product-feed-pro' );?>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) {
|
||||
?>
|
||||
<div class="notice notice-error is-dismissible">
|
||||
<p>
|
||||
<strong><?php _e( 'WARNING: Your WP-Cron is disabled', 'woo-product-feed-pro' );?></strong><br/></br/>
|
||||
We detected that your WP-cron has been disabled in your wp-config.php file. Our plugin heavily depends on the WP-cron being active otherwise it cannot update and generate your product feeds. <a href="https://adtribes.io/help-my-feed-processing-is-stuck/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=cron-warning&utm_content=notification" target="_blank"><strong>Please enable your WP-cron first</strong></a>.
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
// Double check if the woosea_cron_hook is there, when it is not create a new one
|
||||
if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
|
||||
wp_schedule_event ( time(), 'hourly', 'woosea_cron_hook');
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="woo-product-feed-pro-form-style-2-heading"><?php _e( 'Manage feeds','woo-product-feed-pro' );?></div>
|
||||
<div class="woo-product-feed-pro-table-wrapper">
|
||||
<div class="woo-product-feed-pro-table-left">
|
||||
|
||||
<table id="woosea_main_table" class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong><?php _e( 'Active','woo-product-feed-pro' );?></strong></td>
|
||||
<td><strong><?php _e( 'Project name and channel','woo-product-feed-pro' );?></strong></td>
|
||||
<td><strong><?php _e( 'Format','woo-product-feed-pro' );?></strong></td>
|
||||
<td><strong><?php _e( 'Refresh interval','woo-product-feed-pro' );?></strong></td>
|
||||
<td><strong><?php _e( 'Status','woo-product-feed-pro' );?></strong></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
if($cron_projects){
|
||||
$toggle_count = 1;
|
||||
$class = "";
|
||||
|
||||
foreach ($cron_projects as $key=>$val){
|
||||
if(isset($val['active']) AND ($val['active'] == "true")){
|
||||
$checked = "checked";
|
||||
$class = "";
|
||||
} else {
|
||||
$checked = "";
|
||||
}
|
||||
|
||||
if(isset($val['filename'])){
|
||||
$projectname = ucfirst($val['projectname']);
|
||||
?>
|
||||
<form action="" method="post">
|
||||
<tr class="<?php print "$class";?>">
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<input type="hidden" name="manage_record" value="<?php print "$val[project_hash]";?>"><input type="checkbox" name="project_active[]" class="checkbox-field" value="<?php print "$val[project_hash]";?>" <?php print "$checked";?>>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
<td><span><?php print "$projectname</span><br/><span class=\"woo-product-feed-pro-channel\">Channel: $val[name]</span>";?></span></td>
|
||||
<td><span><?php print "$val[fileformat]";?></span></td>
|
||||
<td><span><?php print "$val[cron]";?></span></td>
|
||||
<?php
|
||||
if ($val['running'] == "processing"){
|
||||
$proc_perc = round(($val['nr_products_processed']/$val['nr_products'])*100);
|
||||
print "<td><span class=\"woo-product-feed-pro-blink_me\" id=\"woosea_proc_$val[project_hash]\">$val[running] ($proc_perc%)</span></td>";
|
||||
} else {
|
||||
print "<td><span class=\"woo-product-feed-pro-blink_off_$val[project_hash]\" id=\"woosea_proc_$val[project_hash]\">$val[running]</span></td>";
|
||||
}
|
||||
?>
|
||||
<td>
|
||||
<div class="actions">
|
||||
<span class="gear dashicons dashicons-admin-generic" id="gear_<?php print "$val[project_hash]";?>" title="project settings" style="display: inline-block;"></span>
|
||||
<?php
|
||||
if ($val['running'] != "processing"){
|
||||
?>
|
||||
<?php
|
||||
if ($val['active'] == "true"){
|
||||
print "<span class=\"dashicons dashicons-admin-page\" id=\"copy_$val[project_hash]\" title=\"copy project\" style=\"display: inline-block;\"></span>";
|
||||
print "<span class=\"dashicons dashicons-update\" id=\"refresh_$val[project_hash]\" title=\"manually refresh productfeed\" style=\"display: inline-block;\"></span>";
|
||||
|
||||
if($val['running'] != "not run yet"){
|
||||
print "<a href=\"$val[external_file]\" target=\"_blank\" class=\"dashicons dashicons-download\" id=\"download\" title=\"download productfeed\" style=\"display: inline-block\"></a>";
|
||||
}
|
||||
}?>
|
||||
<span class="trash dashicons dashicons-trash" id="trash_<?php print "$val[project_hash]";?>" title="delete project and productfeed" style="display: inline-block;"></span>
|
||||
<?php
|
||||
} else {
|
||||
print "<span class=\"dashicons dashicons-dismiss\" id=\"cancel_$val[project_hash]\" title=\"cancel processing productfeed\" style=\"display: inline-block;\"></span>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="manage_inline" colspan="8">
|
||||
<div>
|
||||
<table class="woo-product-feed-pro-inline_manage">
|
||||
|
||||
<?php
|
||||
if (($val['running'] == "ready") OR ($val['running'] == "stopped") OR($val['running'] == "not run yet")){
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<strong><?php _e( 'Change settings','woo-product-feed-pro' );?></strong><br/>
|
||||
<span class="dashicons dashicons-arrow-right" style="display: inline-block;"></span> <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=0&project_hash=<?php print "$val[project_hash]";?>&channel_hash=<?php print "$val[channel_hash]";?>"><?php _e( 'General feed settings','woo-product-feed-pro' );?></a><br/>
|
||||
<?php
|
||||
if ($val['fields'] == "standard"){
|
||||
print "<span class=\"dashicons dashicons-arrow-right\" style=\"display: inline-block;\"></span> <a href=\"admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=2&project_hash=$val[project_hash]&channel_hash=$val[channel_hash]\">"; _e( 'Attribute selection','woo-product-feed-pro' ); print"</a></br/>";
|
||||
} else {
|
||||
print "<span class=\"dashicons dashicons-arrow-right\" style=\"display: inline-block;\"></span> <a href=\"admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=7&project_hash=$val[project_hash]&channel_hash=$val[channel_hash]\">"; _e( 'Field mapping','woo-product-feed-pro' ); print"</a><br/>";
|
||||
}
|
||||
|
||||
if ($val['taxonomy'] != "none"){
|
||||
print "<span class=\"dashicons dashicons-arrow-right\" style=\"display: inline-block;\"></span> <a href=\"admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=1&project_hash=$val[project_hash]&channel_hash=$val[channel_hash]\">"; _e( 'Category mapping','woo-product-feed-pro' ); print"</a><br/>";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ((isset($add_manipulation_support)) AND ($add_manipulation_support == "yes")){
|
||||
?>
|
||||
<span class="dashicons dashicons-arrow-right" style="display: inline-block;"></span> <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=9&project_hash=<?php print "$val[project_hash]";?>&channel_hash=<?php print "$val[channel_hash]";?>"><?php _e( 'Product data manipulation','woo-product-feed-pro');?></a><br/>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<span class="dashicons dashicons-arrow-right" style="display: inline-block;"></span> <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=4&project_hash=<?php print "$val[project_hash]";?>&channel_hash=<?php print "$val[channel_hash]";?>"><?php _e( 'Feed filters and rules','woo-product-feed-pro' );?></a><br/>
|
||||
<span class="dashicons dashicons-arrow-right" style="display: inline-block;"></span> <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=5&project_hash=<?php print "$val[project_hash]";?>&channel_hash=<?php print "$val[channel_hash]";?>"><?php _e( 'Conversion & Google Analytics settings' );?></a><br/>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<strong><?php _e( 'Feed URL','woo-product-feed-pro' );?></strong><br/>
|
||||
<?php
|
||||
if (($val['active'] == "true") AND ($val['running'] != "not run yet")){
|
||||
print "<span class=\"dashicons dashicons-arrow-right\" style=\"display: inline-block;\"></span> <a href=\"$val[external_file]\" target=\"_blank\">$val[external_file]</a>";
|
||||
} else {
|
||||
print "<span class=\"dashicons dashicons-warning\"></span> Whoops, there is no active product feed for this project as the project has been disabled or did not run yet.";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
<?php
|
||||
$toggle_count++;
|
||||
} else {
|
||||
// Removing this partly configured feed as it results in PHP warnings
|
||||
unset($cron_projects[$key]);
|
||||
update_option('cron_projects', $cron_projects,'no');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="6"><br/><span class="dashicons dashicons-warning"></span> <?php _e( 'You didn\'t configured a product feed yet','woo-product-feed-pro' );?>, <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php"><?php _e( 'please create one first</a> or read our tutorial on','woo-product-feed-pro' );?> <a href="https://adtribes.io/setting-up-your-first-google-shopping-product-feed/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=first shopping feed" target="_blank"><?php _e( 'how to set up your very first Google Shopping product feed','woo-product-feed-pro' );?></a>.<br/><br/></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="woo-product-feed-pro-table-right">
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong><?php _e( 'Why upgrade to Elite?','woo-product-feed-pro' );?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php _e ('Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!','woo-product-feed-pro' );?>
|
||||
<ul>
|
||||
<li><strong>1.</strong> <?php _e( 'Priority support: get your feeds live faster','woo-product-feed-pro' );?></li>
|
||||
<li><strong>2.</strong> <?php _e( 'More products approved by Google','woo-product-feed-pro' );?></li>
|
||||
<li><strong>3.</strong> <?php _e( 'Add GTIN, brand and more fields to your store','woo-product-feed-pro' );?></li>
|
||||
<li><strong>4.</strong> <?php _e( 'Exclude individual products from your feeds','woo-product-feed-pro' );?></li>
|
||||
<li><strong>5.</strong> <?php _e( 'WPML support','woo-product-feed-pro' );?></li>
|
||||
<li><strong>6.</strong> <?php _e( 'Aelia currency switcher support','woo-product-feed-pro' );?></li>
|
||||
<li><strong>7.</strong> <?php _e( 'Facebook pixel feature','woo-product-feed-pro' );?></li>
|
||||
<li><strong>8.</strong> <?php _e( 'Polylang support','woo-product-feed-pro' );?></li>
|
||||
</ul>
|
||||
<strong>
|
||||
<a href="https://adtribes.io/pro-vs-elite/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=why-upgrade-box" target="_blank"><?php _e( 'Upgrade to Elite here!','woo-product-feed-pro' );?></a>
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong><?php _e( 'We have got you covered!','woo-product-feed-pro' );?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php _e( 'Need assistance? Check out our:','woo-product-feed-pro' );?>
|
||||
<ul>
|
||||
<li><strong><a href="https://adtribes.io/support/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=faq" target="_blank"><?php _e( 'Frequently Asked Questions','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank"><?php _e( 'YouTube tutorials','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong><a href="https://adtribes.io/tutorials/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=tutorials" target="_blank"><?php _e( 'Tutorials','woo-product-feed-pro' );?></a></strong></li>
|
||||
</ul>
|
||||
<?php _e( 'Or just reach out to us at','woo-product-feed-pro' );?> <strong><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/" target="_blank"><?php _e( 'our Wordpress forum','woo-product-feed-pro' );?></a></strong> <?php _e( 'and we will make sure your product feeds will be up-and-running within no-time.','woo-product-feed-pro' );?>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong><?php _e( 'Our latest tutorials','woo-product-feed-pro' );?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li><strong>1. <a href="https://adtribes.io/setting-up-your-first-google-shopping-product-feed/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=first shopping feed" target="_blank"><?php _e( 'Create a Google Shopping feed','woo-product-feed-pro' );?></a></strong></li>
|
||||
|
||||
<li><strong>2. <a href="https://adtribes.io/feature-product-data-manipulation/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=product_data_manipulation" target="_blank"><?php _e( 'Product data manipulation','woo-product-feed-pro' );?></a></strong></li>
|
||||
|
||||
<li><strong>3. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=how to create filters" target="_blank"><?php _e( 'How to create filters for your product feed','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>4. <a href="https://adtribes.io/how-to-create-rules/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=how to create rules" target="_blank"><?php _e( 'How to set rules for your product feed','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>5. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=adding fields" target="_blank"><?php _e( 'Adding GTIN, Brand, MPN and more','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>6. <a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=structured data bug" target="_blank"><?php _e( 'WooCommerce structured data markup bug','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>7. <a href="https://adtribes.io/wpml-support/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=wpml support" target="_blank"><?php _e( 'Enable WPML support','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>8. <a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=aelia support" target="_blank"><?php _e( 'Enable Aelia currency switcher support','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>9. <a href="https://adtribes.io/help-my-feed-processing-is-stuck/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=feed stuck" target="_blank"><?php _e( 'Help, my feed is stuck!','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>10. <a href="https://adtribes.io/help-i-have-none-or-less-products-in-my-product-feed-than-expected/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=too few products" target="_blank"><?php _e( 'Help, my feed has no or too few products!','woo-product-feed-pro');?></a></strong></li>
|
||||
<li><strong>11. <a href="https://adtribes.io/polylang-support-product-feeds/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=polylang support" target="_blank"><?php _e( 'How to use the Polylang feature', 'woo-product-feed-pro' );?></a></strong></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</tbody>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,688 @@
|
||||
<?php
|
||||
$domain = sanitize_text_field($_SERVER['HTTP_HOST']);
|
||||
$plugin_settings = get_option( 'plugin_settings' );
|
||||
$license_information = get_option( 'license_information' );
|
||||
$host = sanitize_text_field($_SERVER['HTTP_HOST']);
|
||||
$directory_perm_xml = "";
|
||||
$directory_perm_csv = "";
|
||||
$directory_perm_txt = "";
|
||||
$directory_perm_tsv = "";
|
||||
$directory_perm_logs = "";
|
||||
|
||||
$elite_disable = "enabled";
|
||||
if(($license_information['license_valid'] == "false") OR (!is_array($license_information))){
|
||||
$elite_disable = "disabled";
|
||||
}
|
||||
|
||||
if(empty($license_information['license_email'])){
|
||||
$license_information['license_email'] = "";
|
||||
}
|
||||
if(empty($license_information['license_key'])){
|
||||
$license_information['license_key'] = "";
|
||||
}
|
||||
|
||||
$versions = array (
|
||||
"PHP" => (float)phpversion(),
|
||||
"Wordpress" => get_bloginfo('version'),
|
||||
"WooCommerce" => WC()->version,
|
||||
"WooCommerce Product Feed PRO" => WOOCOMMERCESEA_PLUGIN_VERSION
|
||||
);
|
||||
|
||||
/**
|
||||
* Create notification object and get message and message type as WooCommerce is inactive
|
||||
* also set variable allowed on 0 to disable submit button on step 1 of configuration
|
||||
*/
|
||||
$notifications_obj = new WooSEA_Get_Admin_Notifications;
|
||||
if (!in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '9', 'false' );
|
||||
} else {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '14', 'false' );
|
||||
}
|
||||
|
||||
if ($versions['PHP'] < 5.6){
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '11', 'false' );
|
||||
$php_validation = "False";
|
||||
} else {
|
||||
$php_validation = "True";
|
||||
}
|
||||
|
||||
if ($versions['WooCommerce'] < 3){
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '13', 'false' );
|
||||
}
|
||||
|
||||
if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '12', 'false' );
|
||||
}
|
||||
|
||||
if(array_key_exists('notice', $license_information)){
|
||||
if($license_information['notice'] == "true"){
|
||||
$notifications_box['message_type'] = $license_information['message_type'];
|
||||
$notifications_box['message'] = $license_information['message'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Change default footer text, asking to review our plugin
|
||||
**/
|
||||
function my_footer_text($default) {
|
||||
return _e( 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">★★★★★</a> rating. Thanks in advance!','woo-product-feed-pro' );
|
||||
}
|
||||
add_filter('admin_footer_text', 'my_footer_text');
|
||||
|
||||
|
||||
//we check if the page is visited by click on the tabs or on the menu button.
|
||||
//then we get the active tab.
|
||||
$active_tab = "woosea_manage_settings";
|
||||
|
||||
// create nonce
|
||||
$nonce = wp_create_nonce( 'woosea_ajax_nonce' );
|
||||
|
||||
$header_text = __( 'Plugin settings', 'woo-product-feed-pro' );
|
||||
if(isset($_GET["tab"])) {
|
||||
if($_GET["tab"] == "woosea_manage_settings"){
|
||||
$active_tab = "woosea_manage_settings";
|
||||
$header_text = __( 'Plugin settings', 'woo-product-feed-pro' );
|
||||
} elseif ($_GET["tab"] == "woosea_system_check"){
|
||||
$active_tab = "woosea_system_check";
|
||||
$header_text = __( 'Plugin systems check', 'woo-product-feed-pro' );
|
||||
} else {
|
||||
$active_tab = "woosea_manage_attributes";
|
||||
$header_text = __( 'Attribute settings', 'woo-product-feed-pro' );
|
||||
$license_information['message'] = __( 'Add extra fields to your product (edit) pages so you can add Brands, GTINs, Size, Color and many more fields to your product feeds.<br/><br/>This plugin, by default, only shows a limit amount of the extra fields in the configuration, product edit pages ond filter/rule drop-downs. We have done so for performance reasons and usability. You can however add missing extra fields by enabling them below. After enabling an extra field it shows on the product edit pages and the drop-downs during configuration so you can use them for your product feeds.', 'woo-product-feed-pro' );
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
|
||||
<div class="woo-product-feed-pro-form-style-2">
|
||||
|
||||
<tbody class="woo-product-feed-pro-body">
|
||||
<div class="woo-product-feed-pro-form-style-2-heading">
|
||||
<span>
|
||||
<?php
|
||||
print "$header_text";
|
||||
?>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) {
|
||||
?>
|
||||
<div class="notice notice-error is-dismissible">
|
||||
<p>
|
||||
<strong><?php _e( 'WARNING: Your WP-Cron is disabled', 'woo-product-feed-pro' );?></strong><br/></br/>
|
||||
We detected that your WP-cron has been disabled in your wp-config.php file. Our plugin heavily depends on the WP-cron being active for it to be able to update and generate your product feeds. More information on the inner workings of our plugin and instructions on how to enable your WP-Cron can be found here: <a href="https://adtribes.io/help-my-feed-processing-is-stuck/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=cron-warning&utm_content=notification" target="_blank"><strong>My feed won't update or is stuck processing</strong></a>.
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<!-- wordpress provides the styling for tabs. -->
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<!-- when tab buttons are clicked we jump back to the same page but with a new parameter that represents the clicked tab. accordingly we make it active -->
|
||||
<a href="?page=woosea_manage_settings&tab=woosea_manage_settings" class="nav-tab <?php if($active_tab == 'woosea_manage_settings'){echo 'nav-tab-active';} ?> "><?php _e('Plugin settings', 'woo-product-feed-pro'); ?></a>
|
||||
<a href="?page=woosea_manage_settings&tab=woosea_system_check" class="nav-tab <?php if($active_tab == 'woosea_system_check'){echo 'nav-tab-active';} ?>"><?php _e('Plugin systems check', 'woo-product-feed-pro'); ?></a>
|
||||
</h2>
|
||||
|
||||
<div class="woo-product-feed-pro-table-wrapper">
|
||||
<div class="woo-product-feed-pro-table-left">
|
||||
<?php
|
||||
if($active_tab == "woosea_manage_settings"){
|
||||
?>
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr><td><strong><?php _e( 'Plugin setting', 'woo-product-feed-pro' );?></strong></td><td><strong><?php _e( 'Off / On', 'woo-product-feed-pro' );?></strong></td></tr>
|
||||
|
||||
<form action="" method="post">
|
||||
<?php wp_nonce_field( 'woosea_ajax_nonce' ); ?>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<span><?php _e( 'Use parent variable product image for variations', 'woo-product-feed-pro');?></span>
|
||||
</td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
$add_mother_image = get_option ('add_mother_image');
|
||||
if($add_mother_image == "yes"){
|
||||
print "<input type=\"checkbox\" id=\"add_mother_image\" name=\"add_mother_image\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"add_mother_image\" name=\"add_mother_image\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span><?php _e( 'Add shipping costs for all countries to your feed (Google Shopping / Facebook only)', 'woo-product-feed-pro');?></span>
|
||||
</td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
$add_all_shipping = get_option ('add_all_shipping');
|
||||
if($add_all_shipping == "yes"){
|
||||
print "<input type=\"checkbox\" id=\"add_all_shipping\" name=\"add_all_shipping\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"add_all_shipping\" name=\"add_all_shipping\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span><?php _e( 'Remove all other shipping classes when free shipping criteria are met (Google Shopping / Facebook only)', 'woo-product-feed-pro');?></span>
|
||||
</td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
$free_shipping = get_option ('free_shipping');
|
||||
if($free_shipping == "yes"){
|
||||
print "<input type=\"checkbox\" id=\"free_shipping\" name=\"free_shipping\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"free_shipping\" name=\"free_shipping\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span><?php _e( 'Remove the free shipping zone from your feed (Google Shopping / Facebook only)', 'woo-product-feed-pro');?></span>
|
||||
</td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
$remove_free_shipping = get_option ('remove_free_shipping');
|
||||
if($remove_free_shipping == "yes"){
|
||||
print "<input type=\"checkbox\" id=\"remove_free_shipping\" name=\"remove_free_shipping\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"remove_free_shipping\" name=\"remove_free_shipping\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span><?php _e( 'Remove the local pickup shipping zone from your feed (Google Shopping / Facebook only)', 'woo-product-feed-pro');?></span>
|
||||
</td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
$local_pickup_shipping = get_option ('local_pickup_shipping');
|
||||
if($local_pickup_shipping == "yes"){
|
||||
print "<input type=\"checkbox\" id=\"local_pickup_shipping\" name=\"local_pickup_shipping\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"local_pickup_shipping\" name=\"local_pickup_shipping\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span><?php _e( 'Show only basis attributes in field mapping and filter/rule drop-downs', 'woo-product-feed-pro');?></span>
|
||||
</td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
$add_woosea_basic = get_option ('add_woosea_basic');
|
||||
if($add_woosea_basic == "yes"){
|
||||
print "<input type=\"checkbox\" id=\"add_woosea_basic\" name=\"add_woosea_basic\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"add_woosea_basic\" name=\"add_woosea_basic\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span><?php _e( 'Enable logging', 'woo-product-feed-pro');?></span>
|
||||
</td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
$add_woosea_logging = get_option ('add_woosea_logging');
|
||||
if($add_woosea_logging == "yes"){
|
||||
print "<input type=\"checkbox\" id=\"add_woosea_logging\" name=\"add_woosea_logging\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"add_woosea_logging\" name=\"add_woosea_logging\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<td>
|
||||
<span><?php _e( 'Add CDATA to title, description and short description:', 'woo-product-feed-pro');?></span>
|
||||
</td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
$add_woosea_cdata = get_option ('add_woosea_cdata');
|
||||
if($add_woosea_cdata == "yes"){
|
||||
print "<input type=\"checkbox\" id=\"add_woosea_cdata\" name=\"add_woosea_cdata\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"add_woosea_cdata\" name=\"add_woosea_cdata\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
-->
|
||||
|
||||
<tr id="facebook_pixel">
|
||||
<td>
|
||||
<span><?php _e( 'Add Facebook Pixel', 'woo-product-feed-pro');?> (<a href="https://adtribes.io/facebook-pixel-feature/" target="_blank"><?php _e( 'Read more about this', 'woo-product-feed-pro' );?>)</a></span>
|
||||
</td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
$add_facebook_pixel = get_option ('add_facebook_pixel');
|
||||
if($add_facebook_pixel == "yes"){
|
||||
print "<input type=\"checkbox\" id=\"add_facebook_pixel\" name=\"add_facebook_pixel\" class=\"checkbox-field\" value=\"$nonce\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"add_facebook_pixel\" name=\"add_facebook_pixel\" class=\"checkbox-field\" value=\"$nonce\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if($add_facebook_pixel == "yes"){
|
||||
$facebook_pixel_id = get_option('woosea_facebook_pixel_id');
|
||||
print "<tr id=\"facebook_pixel_id\"><td colspan=\"2\"><span>Insert your Facebook Pixel ID</span> <input type=\"hidden\" name=\"nonce_facebook_pixel_id\" id=\"nonce_facebook_pixel_id\" value=\"$nonce\"><input type=\"text\" class=\"input-field-medium\" id=\"fb_pixel_id\" name=\"fb_pixel_id\" value=\"$facebook_pixel_id\"> <input type=\"button\" id=\"save_facebook_pixel_id\" value=\"Save\"></td></tr>";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$content_ids = "variation";
|
||||
$content_ids = get_option( 'add_facebook_pixel_content_ids' );
|
||||
?>
|
||||
|
||||
<tr id="content_ids">
|
||||
<td colspan="2">
|
||||
<span><?php _e( 'Content IDS variable products Facebook Pixel', 'woo-product-feed-pro');?></span>
|
||||
<select id="woosea_content_ids" name="woosea_content_ids" class="select-field">
|
||||
<?php
|
||||
if($content_ids == "variation"){
|
||||
print "<option value=\"variation\" selected>Variation product ID's</option>";
|
||||
print "<option value=\"variable\">Variable product ID</option>";
|
||||
} else {
|
||||
print "<option value=\"variation\" selected>Variation product ID's</option>";
|
||||
print "<option value=\"variable\" selected>Variable product ID</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if($elite_disable == "enabled"){
|
||||
?>
|
||||
<tr class="<?php print"$elite_disable";?>" id="facebook_capi">
|
||||
<td>
|
||||
<span><?php _e( 'Enable Facebook Conversion API:', 'woo-product-feed-pro');?> (<a href="https://adtribes.io/facebook-conversion-api/" target="_blank"><?php _e( 'Read more about this', 'woo-product-feed-pro' );?>)</a></span>
|
||||
</td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
$add_facebook_capi = get_option ('add_facebook_capi');
|
||||
if($add_facebook_capi == "yes"){
|
||||
print "<input type=\"checkbox\" id=\"add_facebook_capi\" name=\"add_facebook_capi\" class=\"checkbox-field\" value=\"$nonce\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"add_facebook_capi\" name=\"add_facebook_capi\" class=\"checkbox-field\" value=\"$nonce\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if($add_facebook_capi == "yes"){
|
||||
$facebook_capi_token = get_option('woosea_facebook_capi_token');
|
||||
print "<tr id=\"facebook_capi_token\"><td colspan=\"2\"><span>Insert your Facebook Conversion API token:</span><br/><br/><input type=\"hidden\" name=\"nonce_facebook_capi_id\" id=\"nonce_facebook_capi_id\" value=\"$nonce\"><input type=\"textarea\" class=\"textarea-field\" id=\"fb_capi_token\" name=\"fb_capi_token\" value=\"$facebook_capi_token\"><br/><br/><input type=\"button\" id=\"save_facebook_capi_token\" value=\"Save\"></td></tr>";
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr id="remarketing">
|
||||
<td>
|
||||
<span><?php _e( 'Add Google Dynamic Remarketing Pixel:', 'woo-product-feed-pro');?></span>
|
||||
</td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
$add_remarketing = get_option ('add_remarketing');
|
||||
if($add_remarketing == "yes"){
|
||||
print "<input type=\"checkbox\" id=\"add_remarketing\" name=\"add_remarketing\" class=\"checkbox-field\" value=\"$nonce\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"add_remarketing\" name=\"add_remarketing\" class=\"checkbox-field\" value=\"$nonce\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if($add_remarketing == "yes"){
|
||||
$adwords_conversion_id = get_option('woosea_adwords_conversion_id');
|
||||
|
||||
print "<tr id=\"adwords_conversion_id\"><td colspan=\"2\"><span>Insert your Dynamic Remarketing Conversion tracking ID:</span> <input type=\"hidden\" name=\"nonce_adwords_conversion_id\" id=\"nonce_adwords_conversion_id\" value=\"$nonce\"><input type=\"text\" class=\"input-field-medium\" id=\"adwords_conv_id\" name=\"adwords_conv_id\" value=\"$adwords_conversion_id\"> <input type=\"button\" id=\"save_conversion_id\" value=\"Save\"></td></tr>";
|
||||
}
|
||||
?>
|
||||
|
||||
<tr id="batch">
|
||||
<td>
|
||||
<span><?php _e( 'Change products per batch number', 'woo-product-feed-pro');?> (<a href="https://adtribes.io/batch-size-configuration-product-feed/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_content=batch size" target="_blank"><?php _e( 'Read more about this', 'woo-product-feed-pro' );?>)</a></span>
|
||||
</td>
|
||||
<td>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<?php
|
||||
$add_batch = get_option ('add_batch');
|
||||
if($add_batch == "yes"){
|
||||
print "<input type=\"checkbox\" id=\"add_batch\" name=\"add_batch\" class=\"checkbox-field\" checked>";
|
||||
} else {
|
||||
print "<input type=\"checkbox\" id=\"add_batch\" name=\"add_batch\" class=\"checkbox-field\">";
|
||||
}
|
||||
?>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if($add_batch == "yes"){
|
||||
$woosea_batch_size = get_option('woosea_batch_size');
|
||||
print "<tr id=\"woosea_batch_size\"><td colspan=\"2\"><span>Insert batch size:</span> <input type=\"hidden\" name=\"nonce_batch\" id=\"nonce_batch\" value=\"$nonce\"><input type=\"text\" class=\"input-field-medium\" id=\"batch_size\" name=\"batch_size\" value=\"$woosea_batch_size\"> <input type=\"button\" id=\"save_batch_size\" value=\"Save\"></td></tr>";
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</table>
|
||||
<?php
|
||||
} elseif ($active_tab == "woosea_system_check"){
|
||||
// Check if the product feed directory is writeable
|
||||
$upload_dir = wp_upload_dir();
|
||||
$external_base = $upload_dir['basedir'];
|
||||
$external_path = $external_base . "/woo-product-feed-pro/";
|
||||
$external_path_xml = $external_base . "/woo-product-feed-pro/";
|
||||
$external_path_csv = $external_base . "/woo-product-feed-pro/";
|
||||
$external_path_txt = $external_base . "/woo-product-feed-pro/";
|
||||
$external_path_tsv = $external_base . "/woo-product-feed-pro/";
|
||||
$external_path_logs = $external_base . "/woo-product-feed-pro/";
|
||||
$test_file = $external_path . "/tesfile.txt";
|
||||
$test_file_xml = $external_path . "xml/tesfile.txt";
|
||||
$test_file_csv = $external_path . "csv/tesfile.txt";
|
||||
$test_file_txt = $external_path . "txt/tesfile.txt";
|
||||
$test_file_tsv = $external_path . "tsv/tesfile.txt";
|
||||
$test_file_logs = $external_path . "logs/tesfile.txt";
|
||||
|
||||
if (is_writable($external_path)) {
|
||||
// Normal root category
|
||||
$fp = @fopen($test_file, 'w');
|
||||
@fwrite($fp, 'Cats chase mice');
|
||||
@fclose($fp);
|
||||
if(is_file($test_file)){
|
||||
$directory_perm = "True";
|
||||
}
|
||||
|
||||
// XML subcategory
|
||||
$fp = @fopen($test_file_xml, 'w');
|
||||
if(!is_bool($fp)){
|
||||
@fwrite($fp, 'Cats chase mice');
|
||||
@fclose($fp);
|
||||
if(is_file($test_file_xml)){
|
||||
$directory_perm_xml = "True";
|
||||
} else {
|
||||
$directory_perm_xml = "False";
|
||||
}
|
||||
} else {
|
||||
$directory_perm_xml = "Unknown";
|
||||
}
|
||||
|
||||
// CSV subcategory
|
||||
$fp = @fopen($test_file_csv, 'w');
|
||||
if(!is_bool($fp)){
|
||||
@fwrite($fp, 'Cats chase mice');
|
||||
@fclose($fp);
|
||||
if(is_file($test_file_csv)){
|
||||
$directory_perm_csv = "True";
|
||||
} else {
|
||||
$directory_perm_csv = "False";
|
||||
}
|
||||
} else {
|
||||
$directory_perm_csv = "Unknown";
|
||||
}
|
||||
|
||||
// TXT subcategory
|
||||
$fp = @fopen($test_file_txt, 'w');
|
||||
if(!is_bool($fp)){
|
||||
@fwrite($fp, 'Cats chase mice');
|
||||
@fclose($fp);
|
||||
if(is_file($test_file_txt)){
|
||||
$directory_perm_txt = "True";
|
||||
} else {
|
||||
$directory_perm_txt = "False";
|
||||
}
|
||||
} else {
|
||||
$directory_perm_txt = "Unknown";
|
||||
}
|
||||
// TSV subcategory
|
||||
$fp = @fopen($test_file_tsv, 'w');
|
||||
if(!is_bool($fp)){
|
||||
@fwrite($fp, 'Cats chase mice');
|
||||
@fclose($fp);
|
||||
if(is_file($test_file_tsv)){
|
||||
$directory_perm_tsv = "True";
|
||||
} else {
|
||||
$directory_perm_tsv = "False";
|
||||
}
|
||||
} else {
|
||||
$directory_perm_tsv = "Uknown";
|
||||
}
|
||||
|
||||
// Logs subcategory
|
||||
$fp = @fopen($test_file_logs, 'w');
|
||||
if(!is_bool($fp)){
|
||||
@fwrite($fp, 'Cats chase mice');
|
||||
@fclose($fp);
|
||||
if(is_file($test_file_logs)){
|
||||
$directory_perm_logs = "True";
|
||||
} else {
|
||||
$directory_perm_logs = "False";
|
||||
}
|
||||
} else {
|
||||
$directory_perm_logs = "Unknown";
|
||||
}
|
||||
} else {
|
||||
$directory_perm = "False";
|
||||
}
|
||||
|
||||
// Check if the cron is enabled
|
||||
if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
|
||||
$cron_enabled = "False";
|
||||
} else {
|
||||
$cron_enabled = "True";
|
||||
}
|
||||
|
||||
if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) {
|
||||
$cron_enabled = "<strong>False</strong>";
|
||||
}
|
||||
|
||||
print "<table class=\"woo-product-feed-pro-table\">";
|
||||
print "<tr><td><strong>System check</strong></td><td><strong>Status</strong></td></tr>";
|
||||
print "<tr><td>WP-Cron enabled</td><td>$cron_enabled</td></tr>";
|
||||
print "<tr><td>PHP-version</td><td>$php_validation ($versions[PHP])</td></tr>";
|
||||
print "<tr><td>Product feed directory writable</td><td>$directory_perm</td></tr>";
|
||||
print "<tr><td>Product feed XML directory writable</td><td>$directory_perm_xml</td></tr>";
|
||||
print "<tr><td>Product feed CSV directory writable</td><td>$directory_perm_csv</td></tr>";
|
||||
print "<tr><td>Product feed TXT directory writable</td><td>$directory_perm_txt</td></tr>";
|
||||
print "<tr><td>Product feed TSV directory writable</td><td>$directory_perm_tsv</td></tr>";
|
||||
print "<tr><td>Product feed LOGS directory writable</td><td>$directory_perm_logs</td></tr>";
|
||||
print "<tr><td colspan=\"2\"> </td></tr>";
|
||||
print "</table>";
|
||||
|
||||
} else {
|
||||
?>
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<?php
|
||||
if(!get_option( 'woosea_extra_attributes' )){
|
||||
$extra_attributes = array();
|
||||
} else {
|
||||
$extra_attributes = get_option( 'woosea_extra_attributes' );
|
||||
}
|
||||
print "<tr><td><strong>Attribute name</strong></td><td><strong>On / Off</strong></td></tr>";
|
||||
|
||||
$list = array (
|
||||
"custom_attributes__woosea_brand" => "woosea brand",
|
||||
"custom_attributes__woosea_gtin" => "woosea gtin",
|
||||
"custom_attributes__woosea_ean" => "woosea ean",
|
||||
"custom_attributes__woosea_mpn" => "woosea mpn",
|
||||
"custom_attributes__woosea_optimized_title" => "woosea optimized title",
|
||||
"custom_attributes__woosea_age_group" => "woosea age group",
|
||||
"custom_attributes__woosea_color" => "woosea color",
|
||||
"custom_attributes__woosea_condition" => "woosea condition",
|
||||
"custom_attributes__woosea_cost_of_good_sold" => "woosea cost of good sold",
|
||||
"custom_attributes__woosea_custom_field_0" => "woosea custom field 0",
|
||||
"custom_attributes__woosea_custom_field_1" => "woosea custom field 1",
|
||||
"custom_attributes__woosea_custom_field_2" => "woosea custom field 2",
|
||||
"custom_attributes__woosea_custom_field_3" => "woosea custom field 3",
|
||||
"custom_attributes__woosea_custom_field_4" => "woosea custom field 4",
|
||||
"custom_attributes__woosea_energy_efficiency_class" => "woosea energy efficiency class",
|
||||
"custom_attributes__woosea_exclude_product" => "woosea exclude product",
|
||||
"custom_attributes__woosea_gender" => "woosea gender",
|
||||
"custom_attributes__woosea_installment_amount" => "woosea installment amount",
|
||||
"custom_attributes__woosea_installment_months" => "woosea installment months",
|
||||
"custom_attributes__woosea_is_bundle" => "woosea is bundle",
|
||||
"custom_attributes__woosea_is_promotion" => "woosea is promotion",
|
||||
"custom_attributes__woosea_material" => "woosea material",
|
||||
"custom_attributes__woosea_max_energy_efficiency_class" => "woosea max energy efficiency class",
|
||||
"custom_attributes__woosea_min_energy_efficiency_class" => "woosea min energy efficiency class",
|
||||
"custom_attributes__woosea_multipack" => "woosea multipack",
|
||||
"custom_attributes__woosea_pattern" => "woosea pattern",
|
||||
"custom_attributes__woosea_size" => "woosea size",
|
||||
"custom_attributes__woosea_unit_pricing_base_measure" => "woosea unit pricing base measure",
|
||||
"custom_attributes__woosea_unit_pricing_measure" => "woosea unit pricing measure",
|
||||
"custom_attributes__woosea_upc" => "woosea upc",
|
||||
);
|
||||
|
||||
foreach ($list as $key => $value){
|
||||
// Trim spaces before and after
|
||||
$value = trim($value);
|
||||
|
||||
if(in_array($value, $extra_attributes,TRUE)){
|
||||
$checked = "checked";
|
||||
} else {
|
||||
$checked = "";
|
||||
}
|
||||
|
||||
if(strpos($key, 'woosea')){
|
||||
$value_display = str_replace("woosea", "",$value);
|
||||
|
||||
print "<tr id=\"$key\"><td><span>$value_display</span></td>";
|
||||
print "<td>";
|
||||
?>
|
||||
<label class="woo-product-feed-pro-switch">
|
||||
<input type="hidden" name="manage_attribute" value="<?php print "$key";?>"><input type="checkbox" id="attribute_active" name="<?php print "$value";?>" class="checkbox-field" value="<?php print "$key";?>" <?php print "$checked";?>>
|
||||
<div class="woo-product-feed-pro-slider round"></div>
|
||||
</label>
|
||||
<?php
|
||||
print "</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="woo-product-feed-pro-table-right">
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong><?php _e( 'Why upgrade to Elite?', 'woo-product-feed-pro' );?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php _e( 'Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!', 'woo-product-feed-pro' );?>
|
||||
<ul>
|
||||
<li><strong>1.</strong> <?php _e( 'Priority support: get your feeds live faster', 'woo-product-feed-pro' );?></li>
|
||||
<li><strong>2.</strong> <?php _e( 'More products approved by Google', 'woo-product-feed-pro' );?></li>
|
||||
<li><strong>3.</strong> <?php _e( 'Add GTIN, brand and more fields to your store', 'woo-product-feed-pro' );?></li>
|
||||
<li><strong>4.</strong> <?php _e( 'Exclude individual products from your feeds', 'woo-product-feed-pro' );?></li>
|
||||
<li><strong>5.</strong> <?php _e( 'WPML support', 'woo-product-feed-pro' );?></li>
|
||||
<li><strong>6.</strong> <?php _e( 'Aelia currency switcher support', 'woo-product-feed-pro');?></li>
|
||||
<li><strong>7.</strong> <?php _e( 'Facebook pixel feature', 'woo-product-feed-pro');?></li>
|
||||
<li><strong>8.</strong> <?php _e( 'Polylang support', 'woo-product-feed-pro');?></li>
|
||||
</ul>
|
||||
<strong>
|
||||
<a href="https://adtribes.io/pro-vs-elite/?utm_source=<?php print"$host";?>&utm_medium=manage-settings&utm_campaign=why-upgrade-box" target="_blank"><?php _e( 'Upgrade to Elite here!', 'woo-product-feed-pro' );?></a>
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong><?php _e( 'We’ve got you covered!', 'woo-product-feed-pro' );?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php _e( 'Need assistance? Check out our', 'woo-product-feed-pro' );?>
|
||||
<ul>
|
||||
<li><strong><a href="https://adtribes.io/support/?utm_source=<?php print"$host";?>&utm_medium=manage-settings&utm_campaign=faq" target="_blank"><?php _e( 'Frequently Asked Questions', 'woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank"><?php _e( 'YouTube tutorials', 'woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong><a href="https://adtribes.io/tutorials/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=tutorials" target="_blank"><?php _e( 'Tutorials', 'woo-product-feed-pro' );?></a></strong></li>
|
||||
</ul>
|
||||
<?php _e( 'Or just reach out to us at', 'woo-product-feed-pro' );?> <strong><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/" target="_blank"><?php _e( 'our Wordpress forum', 'woo-product-feed-pro' ); ?></a></strong> <?php _e( 'and we will make sure your product feeds will be up-and-running within no-time.', 'woo-product-feed-pro' );?>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong><?php _e( 'Our latest tutorials', 'woo-product-feed-pro' );?></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li><strong>1. <a href="https://adtribes.io/setting-up-your-first-google-shopping-product-feed/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=first shopping feed" target="_blank"><?php _e( 'Create a Google Shopping feed', 'woo-product-feed-pro' );?></a></strong></li>
|
||||
|
||||
<li><strong>2. <a href="https://adtribes.io/feature-product-data-manipulation/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=product_data_manipulation" target="_blank"><?php _e( 'Product data manipulation','woo-product-feed-pro' );?></a></strong></li>
|
||||
|
||||
<li><strong>3. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=how to create filters" target="_blank"><?php _e( 'How to create filters for your product feed', 'woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>4. <a href="https://adtribes.io/how-to-create-rules/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=how to create rules" target="_blank"><?php _e( 'How to set rules for your product feed', 'woo-product-feed-pro');?></a></strong></li>
|
||||
<li><strong>5. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=adding fields" target="_blank"><?php _e( 'Adding GTIN, Brand, MPN and more', 'woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>6. <a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=structured data bug" target="_blank"><?php _e( 'WooCommerce structured data markup bug', 'woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>7. <a href="https://adtribes.io/wpml-support/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=wpml support" target="_blank"><?php _e( 'Enable WPML support', 'woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>8. <a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=aelia support" target="_blank"><?php _e( 'Enable Aelia currency switcher support','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>9. <a href="https://adtribes.io/help-my-feed-processing-is-stuck/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=feed stuck" target="_blank"><?php _e( 'Help, my feed is stuck!','woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>10. <a href="https://adtribes.io/help-i-have-none-or-less-products-in-my-product-feed-than-expected/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=too few products" target="_blank"><?php _e( 'Help, my feed has no or too few products!', 'woo-product-feed-pro' );?></a></strong></li>
|
||||
<li><strong>11. <a href="https://adtribes.io/polylang-support-product-feeds/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=polylang support" target="_blank"><?php _e( 'How to use the Polylang feature', 'woo-product-feed-pro' );?></a></strong></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</tbody>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,162 @@
|
||||
<?php
|
||||
$plugin_settings = get_option( 'plugin_settings' );
|
||||
$license_information = get_option( 'license_information' );
|
||||
$domain = sanitize_text_field($_SERVER['HTTP_HOST']);
|
||||
$error = "false";
|
||||
$plugin_data = get_plugin_data( __FILE__ );
|
||||
|
||||
$versions = array (
|
||||
"PHP" => (float)phpversion(),
|
||||
"Wordpress" => get_bloginfo('version'),
|
||||
"WooCommerce" => WC()->version,
|
||||
"WooCommerce Product Feed PRO" => WOOCOMMERCESEA_PLUGIN_VERSION
|
||||
);
|
||||
|
||||
// When license has not been checked yet
|
||||
if(empty($license_information['message'])){
|
||||
$license_information['message'] = "You did not purchase a license for our Elite features yet. The structured data fix feature and adding of extra Google Shopping fields to your store can be enabled if you upgrade. Please purchase a license key on <a href=\"https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite\" target=\"_blank\">AdTribes.io</a> when you would like to use the Elite features.";
|
||||
$license_information['message_type'] = "notice notice-info is-dismissible";
|
||||
$license_information['license_key'] = "";
|
||||
$license_information['license_email'] = "";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Change default footer text, asking to review our plugin
|
||||
**/
|
||||
function my_footer_text($default) {
|
||||
return 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">★★★★★</a> rating. Thanks in advance!';
|
||||
}
|
||||
add_filter('admin_footer_text', 'my_footer_text');
|
||||
|
||||
/**
|
||||
* Create notification object and get message and message type as WooCommerce is inactive
|
||||
* also set variable allowed on 0 to disable submit button on step 1 of configuration
|
||||
*/
|
||||
$notifications_obj = new WooSEA_Get_Admin_Notifications;
|
||||
if (!in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '9', 'false' );
|
||||
} else {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '14', 'false' );
|
||||
}
|
||||
|
||||
if ($versions['PHP'] < 5.6){
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '11', 'false' );
|
||||
}
|
||||
|
||||
if ($versions['WooCommerce'] < 3){
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '13', 'false' );
|
||||
}
|
||||
|
||||
if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
|
||||
$notifications_box = $notifications_obj->get_admin_notifications ( '12', 'false' );
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="dialog" title="Basic dialog">
|
||||
<p>
|
||||
<div id="dialogText"></div>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="wrap">
|
||||
<div class="woo-product-feed-pro-form-style-2">
|
||||
<tbody class="woo-product-feed-pro-body">
|
||||
<div class="woo-product-feed-pro-form-style-2-heading">Upgrade to Elite</div>
|
||||
<div class="<?php _e($license_information['message_type']); ?>">
|
||||
<p><?php _e($license_information['message'], 'sample-text-domain' ); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="woo-product-feed-pro-table-wrapper">
|
||||
<div class="woo-product-feed-pro-table-left">
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td>
|
||||
<span>License e-mail:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input-field-large" id="license-email" name="license-email" value="<?php print "$license_information[license_email]";?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<span>License key:</span>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="input-field-large" id="license-key" name="license-key" value="<?php print "$license_information[license_key]";?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"><i>Please note that we will automatically validate your license twice a day.</i></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="submit" id="checklicense" value="Activate license">
|
||||
<input type="submit" id="deactivate_license" value="Deactivate license">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="woo-product-feed-pro-table-right">
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong>Why upgrade to Elite?</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!
|
||||
<ul>
|
||||
<li><strong>1.</strong> More products approved by Google </li>
|
||||
<li><strong>2.</strong> Add GTIN, brand and more fields to your store</li>
|
||||
<li><strong>3.</strong> Exclude individual products from your feeds</li>
|
||||
<li><strong>4.</strong> Priority support</li>
|
||||
</ul>
|
||||
<strong>
|
||||
<a href="https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite" target="_blank">Upgrade to Elite here!</a>
|
||||
</strong>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong>We’ve got you covered!</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Need assistance? Check out our:
|
||||
<ul>
|
||||
<li><strong><a href="https://adtribes.io/support/" target="_blank">Frequently Asked Questions</a></strong></li>
|
||||
<li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
|
||||
<li><strong><a href="https://adtribes.io/tutorials/" target="_blank">Tutorials</a></strong></li>
|
||||
<li><strong><a href="https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite" target="_blank">Upgrade to Elite</a></strong></li>
|
||||
</ul>
|
||||
Or just reach out to us at <strong><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/" target="_blank">the support forum</a></strong> and we'll make sure your product feeds will be up-and-running within no-time.
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
<table class="woo-product-feed-pro-table">
|
||||
<tr>
|
||||
<td><strong>Our latest tutorials</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li><strong>1. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/" target="_blank">Adding GTIN, Brand, MPN and more</a></strong></li>
|
||||
<li><strong>2. <a href="https://adtribes.io/woocommerce-structured-data-bug/" target="_blank">WooCommerce structured data markup bug</a></strong></li>
|
||||
<li><strong>3. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/" target="_blank">How to create filters for your product feed</a></strong></li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</tbody>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user