Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/accelera.../includes/options
File: admin-config.php
'customer_name'=> '',
[1500] Fix | Delete
'customer_email'=> '',
[1501] Fix | Delete
);
[1502] Fix | Delete
$allResponseData = isset($selectedOption['amp-license'][$pathExploded]['all_data']) ? $selectedOption['amp-license'][$pathExploded]['all_data'] : NULL ;
[1503] Fix | Delete
if ($allResponseData!=NULL) {
[1504] Fix | Delete
$selectedOption = (array) get_option('redux_builder_amp',true);
[1505] Fix | Delete
$expiredLicensedata[$pathExploded] = $selectedOption['amp-license'][$pathExploded]['status'] == 'expired' ? 1 : 0 ;
[1506] Fix | Delete
$remainingExpiresDays = date('Y-m-d', strtotime($allResponseData['expires'])) ;
[1507] Fix | Delete
$license_info_lifetime = $allResponseData['expires'];
[1508] Fix | Delete
$today = date('Y-m-d');
[1509] Fix | Delete
$exp_date = $remainingExpiresDays;
[1510] Fix | Delete
$date1 = date_create($today);
[1511] Fix | Delete
$date2 = date_create($exp_date);
[1512] Fix | Delete
$diff = date_diff($date1,$date2);
[1513] Fix | Delete
$days = $diff->format("%a");
[1514] Fix | Delete
if( $license_info_lifetime == 'lifetime' ){
[1515] Fix | Delete
$days = 'Lifetime';
[1516] Fix | Delete
if ($days == 'Lifetime') {
[1517] Fix | Delete
$expire_msg = " Your License is Valid for Lifetime ";
[1518] Fix | Delete
}
[1519] Fix | Delete
}
[1520] Fix | Delete
elseif($today > $exp_date){
[1521] Fix | Delete
$days = -$days;
[1522] Fix | Delete
}
[1523] Fix | Delete
}
[1524] Fix | Delete
[1525] Fix | Delete
$license_status = '';
[1526] Fix | Delete
$isset_Checker = isset($selectedOption['amp-license'][$pathExploded]['status']) ? $selectedOption['amp-license'][$pathExploded]['status'] : NULL;
[1527] Fix | Delete
if ($isset_Checker != NULL) {
[1528] Fix | Delete
if(isset($selectedOption['amp-license'][$pathExploded]['status']) && $selectedOption['amp-license'][$pathExploded]['status']==='valid' || $selectedOption['amp-license'][$pathExploded]['status']==='expired'){
[1529] Fix | Delete
$license_status = $selectedOption['amp-license'][$pathExploded]['status'];
[1530] Fix | Delete
$license_user_name = substr($ampforwp_nameOfUser, 0, strpos($ampforwp_nameOfUser, ' '));
[1531] Fix | Delete
$check_for_Caps = ctype_upper($license_user_name);
[1532] Fix | Delete
if ( $check_for_Caps == 1 ) {
[1533] Fix | Delete
$license_user_name = strtolower($license_user_name);
[1534] Fix | Delete
$license_user_name = ucwords($license_user_name);
[1535] Fix | Delete
}
[1536] Fix | Delete
else{
[1537] Fix | Delete
$license_user_name = ucwords($license_user_name);
[1538] Fix | Delete
}
[1539] Fix | Delete
$currentStatus = 'active valid';
[1540] Fix | Delete
[1541] Fix | Delete
if($ampforwp_nameOfUser=="" && isset($selectedOption['amp-license'][$pathExploded]['all_data']['customer_name'])){
[1542] Fix | Delete
$ampforwp_nameOfUser = $selectedOption['amp-license'][$pathExploded]['all_data']['customer_name'];
[1543] Fix | Delete
}
[1544] Fix | Delete
[1545] Fix | Delete
if(isset($selectedOption['amp-license'][$pathExploded]['all_data']) && $selectedOption['amp-license'][$pathExploded]['all_data']!=""){
[1546] Fix | Delete
$allResponseData = $selectedOption['amp-license'][$pathExploded]['all_data'];
[1547] Fix | Delete
$remainingExpiresDays = date('Y-m-d', strtotime($allResponseData['expires'])) ;
[1548] Fix | Delete
$license_info_lifetime = $allResponseData['expires'];
[1549] Fix | Delete
$today = date('Y-m-d');
[1550] Fix | Delete
$exp_date = $remainingExpiresDays;
[1551] Fix | Delete
$date1 = date_create($today);
[1552] Fix | Delete
$date2 = date_create($exp_date);
[1553] Fix | Delete
$diff = date_diff($date1,$date2);
[1554] Fix | Delete
$days = $diff->format("%a");
[1555] Fix | Delete
if( $license_info_lifetime == 'lifetime' ){
[1556] Fix | Delete
$days = 'Lifetime';
[1557] Fix | Delete
if ($days == 'Lifetime') {
[1558] Fix | Delete
$expire_msg = " Your License is Valid for Lifetime ";
[1559] Fix | Delete
}
[1560] Fix | Delete
}
[1561] Fix | Delete
elseif($today > $exp_date){
[1562] Fix | Delete
$days = -$days;
[1563] Fix | Delete
}
[1564] Fix | Delete
}
[1565] Fix | Delete
[1566] Fix | Delete
if(isset($selectedOption['amp-license'][$pathExploded])){
[1567] Fix | Delete
while ( strlen($selectedOption['amp-license'][$pathExploded]['license']) > 32 ) {
[1568] Fix | Delete
$selectedOption['amp-license'][$pathExploded]['license'] = base64_decode($selectedOption['amp-license'][$pathExploded]['license']);
[1569] Fix | Delete
$amplicense = $selectedOption['amp-license'][$pathExploded]['license'];}
[1570] Fix | Delete
$license_key = $selectedOption['amp-license'][$pathExploded]['license'];
[1571] Fix | Delete
}
[1572] Fix | Delete
[1573] Fix | Delete
$lic_status = isset($selectedOption['amp-license'][$pathExploded]['status']) ? $selectedOption['amp-license'][$pathExploded]['status'] : '';
[1574] Fix | Delete
$lic_uname = isset($selectedOption['amp-license'][$pathExploded]['all_data']['customer_name']) ? $selectedOption['amp-license'][$pathExploded]['all_data']['customer_name'] : '';
[1575] Fix | Delete
$license_user_name = substr($lic_uname, 0, strpos($lic_uname, ' '));
[1576] Fix | Delete
$check_for_Caps = ctype_upper($license_user_name);
[1577] Fix | Delete
if ( $check_for_Caps == 1 ) {
[1578] Fix | Delete
$license_user_name = strtolower($license_user_name);
[1579] Fix | Delete
$license_user_name = ucwords($license_user_name);}
[1580] Fix | Delete
else{ $license_user_name = ucwords($license_user_name); }
[1581] Fix | Delete
[1582] Fix | Delete
if ( isset( $license_user_name ) && $license_user_name!=="" && isset( $days ) ){
[1583] Fix | Delete
if ( $license_status == 'valid' || $lic_status == 'expired' ) {
[1584] Fix | Delete
if ($lic_status == 'expired') { $days = -1; }
[1585] Fix | Delete
[1586] Fix | Delete
$one_of_plugin_expired = 0;
[1587] Fix | Delete
if ( in_array( 1, $expiredLicensedata ) ){
[1588] Fix | Delete
$one_of_plugin_expired = 1;
[1589] Fix | Delete
}
[1590] Fix | Delete
if ( !in_array( 0, $expiredLicensedata ) ){
[1591] Fix | Delete
$one_of_plugin_expired = 0;
[1592] Fix | Delete
}
[1593] Fix | Delete
$exp_id = '';
[1594] Fix | Delete
$expire_msg = '';
[1595] Fix | Delete
$renew_mesg = '';
[1596] Fix | Delete
$span_class = '';
[1597] Fix | Delete
$expire_msg_before = '';
[1598] Fix | Delete
$ZtoS_days = '';
[1599] Fix | Delete
$refresh_addon = '';
[1600] Fix | Delete
$user_refr = '';
[1601] Fix | Delete
$alert_icon = '';
[1602] Fix | Delete
$ext_settings_url = 'ext_url';
[1603] Fix | Delete
$settings_url = esc_url(admin_url('edit.php?post_type=ampforwp&page=structured_data_options'));
[1604] Fix | Delete
if ( $days == 'Lifetime' ) {
[1605] Fix | Delete
$expire_msg = " ".esc_html('Valid for Lifetime')." ";
[1606] Fix | Delete
// $expire_msg = " Active ";
[1607] Fix | Delete
$expire_msg_before = '<span class="before_msg_active">'.esc_html('Your License is').'</span>';
[1608] Fix | Delete
$span_class = "ampforwp_addon_icon dashicons dashicons-yes pro_icon ampforwppro_icon";
[1609] Fix | Delete
$color = 'color:green';
[1610] Fix | Delete
}
[1611] Fix | Delete
else if( $days>=0 && $days<=30 ){
[1612] Fix | Delete
$renew_url = "https://accounts.ampforwp.com/order/?edd_license_key=".esc_attr($license_key)."&download_id=".esc_attr($allResponseData['item_name'])."";
[1613] Fix | Delete
[1614] Fix | Delete
if ($one_of_plugin_expired == 1) {
[1615] Fix | Delete
$expire_msg_before = '<span class="before_msg_active">'.esc_html('One of your').' <span class="lessthan_30" style="color:red;">'.esc_html('license key is').'</span></span>';
[1616] Fix | Delete
$spann_class = "<span class='ampforwp_addon_icon dashicons dashicons-no lttn'></span>";
[1617] Fix | Delete
$expire_msg = '<span class="one_of_expired">'.esc_html("Expired").'</span> '.$spann_class.' <a target="blank" class="renewal-license" href="'.$renew_url.'"><span class="renew-lic">'.esc_html__('Renew', 'accelerated-mobile-pages').'</span></a>';
[1618] Fix | Delete
}
[1619] Fix | Delete
else
[1620] Fix | Delete
{
[1621] Fix | Delete
$expire_msg_before = '<span class="before_msg">'.esc_html('Your License is').'</span> <span class="ampforwp-addon-alert">'.esc_html('expiring in').' '.$days.' '.esc_html('days').'</span><a target="blank" class="renewal-license" href="'.$renew_url.'"><span class="renew-lic">'.esc_html__('Renew', 'accelerated-mobile-pages').'</span></a>';
[1622] Fix | Delete
}
[1623] Fix | Delete
$color = 'color:red';
[1624] Fix | Delete
$alert_icon = '<span class="ampforwp_addon_icon dashicons dashicons-warning pro_warning"></span>';
[1625] Fix | Delete
$trans_check = get_transient( 'ampforwp_addon_set_transient' );
[1626] Fix | Delete
if ( $trans_check !== 'ampforwp_addon_set_transient_value' ){
[1627] Fix | Delete
$refresh_addon = '<a id='.$pathExploded.' data-nonce='.wp_create_nonce('verify_extension').' data-days="'.$days.'" class="days_remain">
[1628] Fix | Delete
<i addon-is-expired class="dashicons dashicons-update-alt" id="refresh_expired_addon"></i>
[1629] Fix | Delete
</a>';
[1630] Fix | Delete
}
[1631] Fix | Delete
}
[1632] Fix | Delete
elseif($days<0){
[1633] Fix | Delete
$ext_settings_url = 'ext_settings_url';
[1634] Fix | Delete
$renew_url = "https://accounts.ampforwp.com/order/?edd_license_key=".esc_attr($license_key)."&download_id=".esc_attr($allResponseData['item_name'])."";
[1635] Fix | Delete
if ($one_of_plugin_expired == 1) {
[1636] Fix | Delete
$expire_msg_before = '<span class="ampforwp_addon_inactive"><span class="ooy">'.esc_html('One of your').'</span> <span class="lthan_0" style="color:red;">'.esc_html('license key is').'</span></span>';
[1637] Fix | Delete
}else{
[1638] Fix | Delete
$expire_msg_before = '<span class="ampforwp_addon_inactive">'.esc_html('Your').' <span class="lthan_0" style="color:red;">'.esc_html('License has been').'</span></span>';
[1639] Fix | Delete
$user_refr = '<a class="user_refr" id='.$pathExploded.' data-nonce='.wp_create_nonce('verify_extension').' data-days="'.$days.'" >
[1640] Fix | Delete
<i addon-is-expired class="dashicons dashicons-update-alt" id="user_refr_addon"></i>
[1641] Fix | Delete
</a>';
[1642] Fix | Delete
}
[1643] Fix | Delete
$expire_msg = " Expired ";
[1644] Fix | Delete
$exp_class = 'expired';
[1645] Fix | Delete
$exp_id = 'exp';
[1646] Fix | Delete
$exp_class_2 = 'renew_license_key_';
[1647] Fix | Delete
$span_class = "ampforwp_addon_icon dashicons dashicons-no ltz";
[1648] Fix | Delete
$renew_mesg = '<a target="blank" class="renewal-license" href="'.$renew_url.'"><span class="renew-lic">'.esc_html__('Renew', 'accelerated-mobile-pages').'</span></a>';
[1649] Fix | Delete
$color = 'color:red';
[1650] Fix | Delete
[1651] Fix | Delete
$trans_check = get_transient( 'ampforwp_addon_set_transient' );
[1652] Fix | Delete
if ( $trans_check !== 'ampforwp_addon_set_transient_value' ){
[1653] Fix | Delete
$refresh_addon = '<a id='.$pathExploded.' data-nonce='.wp_create_nonce('verify_extension').' data-days="'.$days.'" class="days_remain">
[1654] Fix | Delete
<i addon-is-expired class="dashicons dashicons-update-alt" id="refresh_expired_addon"></i>
[1655] Fix | Delete
</a>';
[1656] Fix | Delete
}
[1657] Fix | Delete
}
[1658] Fix | Delete
else{
[1659] Fix | Delete
if ($one_of_plugin_expired == 1) {
[1660] Fix | Delete
$expire_msg_before = '<span class="before_msg_active">'.esc_html('One of your').' <span class="less_than_30" style="color:red;">'.esc_html('license key is').'</span></span>';
[1661] Fix | Delete
}else{
[1662] Fix | Delete
$expire_msg_before = '<span class="before_msg_active">'.esc_html('Your License is').'</span>';
[1663] Fix | Delete
}
[1664] Fix | Delete
if ($one_of_plugin_expired == 1) {
[1665] Fix | Delete
$renew_url = "https://accounts.ampforwp.com/order/?edd_license_key=".esc_attr($license_key)."&download_id=".esc_attr($allResponseData['item_name'])."";
[1666] Fix | Delete
$expire_msg = " <span class='one_of_expired'>".esc_html('Expired')."</span> ";
[1667] Fix | Delete
$renew_mesg = '<a target="blank" class="renewal-license" href="'.$renew_url.'"><span class="renew-lic">'.esc_html__('Renew', 'accelerated-mobile-pages').'</span></a>';
[1668] Fix | Delete
}
[1669] Fix | Delete
else{
[1670] Fix | Delete
$expire_msg = " Active ";
[1671] Fix | Delete
}
[1672] Fix | Delete
if ($one_of_plugin_expired == 1) {
[1673] Fix | Delete
$span_class = "ampforwp_addon_icon dashicons dashicons-no pro_icon";
[1674] Fix | Delete
}
[1675] Fix | Delete
else{
[1676] Fix | Delete
$span_class = "ampforwp_addon_icon dashicons dashicons-yes pro_icon ampforwppro_icon";
[1677] Fix | Delete
}
[1678] Fix | Delete
if ($one_of_plugin_expired == 1) { $color = 'color:red';}
[1679] Fix | Delete
else{ $color = 'color:green'; }
[1680] Fix | Delete
}
[1681] Fix | Delete
if($days<0){ $exp_id = 'exp'; }
[1682] Fix | Delete
$proDetailsProvide = "<div class='ampforwp-addon-main'>
[1683] Fix | Delete
<span class='ampforwp-addon-info'>
[1684] Fix | Delete
".$alert_icon."<span class='activated-plugins'>".esc_html('Hi')." <span class='ampforwp-addon_key_user_name'>".esc_html($license_user_name)."</span>".','."
[1685] Fix | Delete
<span id='active-plugins-dr' data-days=".$days." class=".$days."> ".$expire_msg_before." </span>
[1686] Fix | Delete
<span class='expiredinner_span' data-remain-days=".$days." id=".$exp_id.">".$expire_msg."</span>
[1687] Fix | Delete
<span class='".$span_class."'></span>".$renew_mesg.$refresh_addon.$user_refr ;
[1688] Fix | Delete
$proDetailsProvide .= $ZtoS_days."
[1689] Fix | Delete
</span>
[1690] Fix | Delete
</div>";
[1691] Fix | Delete
}
[1692] Fix | Delete
}
[1693] Fix | Delete
}
[1694] Fix | Delete
}
[1695] Fix | Delete
}
[1696] Fix | Delete
}
[1697] Fix | Delete
}
[1698] Fix | Delete
}
[1699] Fix | Delete
else if( $ampforwp_nameOfUser!="" && !class_exists('AMPExtensionManager') ){
[1700] Fix | Delete
$proDetailsProvide = "<span class='extension-menu-call'><span class='activated-plugins'>Hello, ".esc_html($ampforwp_nameOfUser)."</span> <a class='' href='".esc_url(admin_url('admin.php?page=amp_options&tabid=opt-go-premium'))."'><i class='dashicons-before dashicons-admin-generic'></i></a></span>";
[1701] Fix | Delete
}
[1702] Fix | Delete
[1703] Fix | Delete
if(function_exists('amp_activate') ){
[1704] Fix | Delete
$proDetailsProvide = "<a class='premium_features_btn_txt' href=\"#\"> AMP by Automattic compatibility has been activated</a>";
[1705] Fix | Delete
}
[1706] Fix | Delete
[1707] Fix | Delete
$user = wp_get_current_user();
[1708] Fix | Delete
$permissions = "manage_options";
[1709] Fix | Delete
$amp_access = ampforwp_get_setting('ampforwp-role-based-access');
[1710] Fix | Delete
[1711] Fix | Delete
if( in_array( 'administrator', $user->roles ) ) {
[1712] Fix | Delete
$permissions = "manage_options";
[1713] Fix | Delete
}elseif( in_array( 'editor', $user->roles ) && in_array('editor', $amp_access) ){
[1714] Fix | Delete
$permissions = 'edit_pages';
[1715] Fix | Delete
}elseif( in_array( 'author', $user->roles ) && in_array('author', $amp_access)){
[1716] Fix | Delete
$permissions = 'edit_posts';
[1717] Fix | Delete
}
[1718] Fix | Delete
if (class_exists('WPSEO_Options') && in_array( 'wpseo_manager', $user->roles ) && in_array('wpseo_manager', $amp_access)) {
[1719] Fix | Delete
$permissions = 'edit_pages';
[1720] Fix | Delete
}
[1721] Fix | Delete
$args = array(
[1722] Fix | Delete
// TYPICAL -> Change these values as you need/desire
[1723] Fix | Delete
'opt_name' => 'redux_builder_amp', // This is where your data is stored in the database and also becomes your global variable name.
[1724] Fix | Delete
'display_name' => esc_html__( 'AMPforWP Options','accelerated-mobile-pages' ), // Name that appears at the top of your panel
[1725] Fix | Delete
'menu_type' => 'menu', //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only)
[1726] Fix | Delete
'allow_sub_menu' => true, // Show the sections below the admin menu item or not
[1727] Fix | Delete
'menu_title' => esc_html__( 'AMP', 'accelerated-mobile-pages' ),
[1728] Fix | Delete
'page_title' => esc_html__('Accelerated Mobile Pages Options','accelerated-mobile-pages'),
[1729] Fix | Delete
'display_version' => AMPFORWP_VERSION,
[1730] Fix | Delete
'update_notice' => false,
[1731] Fix | Delete
'intro_text' => $proDetailsProvide,
[1732] Fix | Delete
'global_variable' => '', // Set a different name for your global variable other than the opt_name
[1733] Fix | Delete
'dev_mode' => false, // Show the time the page took to load, etc
[1734] Fix | Delete
'customizer' => false, // Enable basic customizer support,
[1735] Fix | Delete
'async_typography' => false, // Enable async for fonts,
[1736] Fix | Delete
'disable_save_warn' => true,
[1737] Fix | Delete
'open_expanded' => false,
[1738] Fix | Delete
// OPTIONAL -> Give you extra features
[1739] Fix | Delete
'page_priority' => null, // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning.
[1740] Fix | Delete
'page_parent' => 'themes.php', // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters
[1741] Fix | Delete
'page_permissions' => $permissions, // Permissions needed to access the options panel.
[1742] Fix | Delete
'last_tab' => '', // Force your panel to always open to a specific tab (by id)
[1743] Fix | Delete
'page_icon' => 'icon-themes', // Icon displayed in the admin panel next to your menu_title
[1744] Fix | Delete
'page_slug' => 'amp_options', // Page slug used to denote the panel
[1745] Fix | Delete
'save_defaults' => true, // On load save the defaults to DB before user clicks save or not
[1746] Fix | Delete
'default_show' => false, // If true, shows the default value next to each field that is not the default value.
[1747] Fix | Delete
'default_mark' => '', // What to print by the field's title if the value shown is default. Suggested: *
[1748] Fix | Delete
'admin_bar' => false,
[1749] Fix | Delete
'admin_bar_icon' => 'dashicons-admin-generic',
[1750] Fix | Delete
// CAREFUL -> These options are for advanced use only
[1751] Fix | Delete
'output' => false, // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output
[1752] Fix | Delete
'output_tag' => false, // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head
[1753] Fix | Delete
//'domain' => 'redux-framework', // Translation domain key. Don't change this unless you want to retranslate all of Redux.
[1754] Fix | Delete
'footer_credit' => false, // Disable the footer credit of Redux. Please leave if you can help it.
[1755] Fix | Delete
'footer_text' => "",
[1756] Fix | Delete
'show_import_export' => true,
[1757] Fix | Delete
'system_info' => true,
[1758] Fix | Delete
[1759] Fix | Delete
);
[1760] Fix | Delete
[1761] Fix | Delete
Redux::setArgs( "redux_builder_amp", $args );
[1762] Fix | Delete
$tabs = array(
[1763] Fix | Delete
array(
[1764] Fix | Delete
'id' => 'redux-help-tab-1',
[1765] Fix | Delete
'title' => esc_html__( 'Theme Information 1', 'accelerated-mobile-pages' ),
[1766] Fix | Delete
'content' => esc_html__( '<p>This is the tab content, HTML is allowed.</p>', 'accelerated-mobile-pages' )
[1767] Fix | Delete
),
[1768] Fix | Delete
array(
[1769] Fix | Delete
'id' => 'redux-help-tab-2',
[1770] Fix | Delete
'title' => esc_html__( 'Theme Information 2', 'accelerated-mobile-pages' ),
[1771] Fix | Delete
'content' => esc_html__( '<p>This is the tab content, HTML is allowed.</p>', 'accelerated-mobile-pages' )
[1772] Fix | Delete
)
[1773] Fix | Delete
);
[1774] Fix | Delete
Redux::setHelpTab( $opt_name, $tabs );
[1775] Fix | Delete
[1776] Fix | Delete
// Set the help sidebar
[1777] Fix | Delete
$content = esc_html__( '<p>This is the sidebar content, HTML is allowed.</p>', 'accelerated-mobile-pages' );
[1778] Fix | Delete
Redux::setHelpSidebar( $opt_name, $content );
[1779] Fix | Delete
[1780] Fix | Delete
[1781] Fix | Delete
/*
[1782] Fix | Delete
* <--- END HELP TABS
[1783] Fix | Delete
*/
[1784] Fix | Delete
[1785] Fix | Delete
/*
[1786] Fix | Delete
*
[1787] Fix | Delete
* ---> START SECTIONS
[1788] Fix | Delete
*
[1789] Fix | Delete
*/
[1790] Fix | Delete
// AMP by Automattic Compatibility
[1791] Fix | Delete
if(function_exists('amp_activate') ){
[1792] Fix | Delete
Redux::setSection( $opt_name, array(
[1793] Fix | Delete
'id' => 'automatic-amp-features',
[1794] Fix | Delete
'title' => esc_html__( 'AMP By Automattic Settings', 'accelerated-mobile-pages' ),
[1795] Fix | Delete
'icon' => '',
[1796] Fix | Delete
)
[1797] Fix | Delete
);
[1798] Fix | Delete
ampforwp_admin_advertisement_options($opt_name);
[1799] Fix | Delete
ampforwp_page_builders_support_options($opt_name);
[1800] Fix | Delete
ampforwp_admin_performance_options($opt_name);
[1801] Fix | Delete
ampforwp_analytics_options($opt_name);
[1802] Fix | Delete
ampforwp_structure_data_options($opt_name);
[1803] Fix | Delete
ampforwp_notice_bar_options($opt_name);
[1804] Fix | Delete
ampforwp_push_notification_options($opt_name);
[1805] Fix | Delete
ampforwp_admin_contact_form_options($opt_name);
[1806] Fix | Delete
}
[1807] Fix | Delete
[1808] Fix | Delete
[1809] Fix | Delete
// New AMP UX
[1810] Fix | Delete
if(!function_exists('ampforwp_generate_ux_admin_button')){
[1811] Fix | Delete
function ampforwp_generate_ux_admin_button($id='',$type='',$label=''){
[1812] Fix | Delete
$option = "";
[1813] Fix | Delete
if($type=="button"){
[1814] Fix | Delete
if($id=="ampforwp-ux-website-type-section"){
[1815] Fix | Delete
$amp_website_type = ampforwp_get_setup_info('ampforwp-ux-website-type-section');
[1816] Fix | Delete
if($amp_website_type){
[1817] Fix | Delete
$option = '<div class="filled-lbl-blk">
[1818] Fix | Delete
<p class="msg">'.esc_attr($amp_website_type).'</p>
[1819] Fix | Delete
<span class="lbl">Change</span>
[1820] Fix | Delete
</div>';
[1821] Fix | Delete
}else{
[1822] Fix | Delete
$option = '<div class="button btn-red">'.esc_attr($label).'</div>';
[1823] Fix | Delete
}
[1824] Fix | Delete
}else if($id=="ampforwp-ux-privacy-section"){
[1825] Fix | Delete
$setup_txt = ampforwp_get_setup_info('ampforwp-ux-privacy-section');
[1826] Fix | Delete
if($setup_txt!=""){
[1827] Fix | Delete
$option = '<div class="filled-lbl-blk">
[1828] Fix | Delete
<p class="msg">'.esc_attr($setup_txt).'</p>
[1829] Fix | Delete
<span class="lbl">Change</span>
[1830] Fix | Delete
</div>';
[1831] Fix | Delete
}else{
[1832] Fix | Delete
$option = '<div class="button btn-red">'.esc_attr($label).'</div>';
[1833] Fix | Delete
}
[1834] Fix | Delete
}else if($id=="ampforwp-ux-need-type-section"){
[1835] Fix | Delete
$need_type=ampforwp_get_setup_info('ampforwp-ux-need-type-section');
[1836] Fix | Delete
if($need_type!=""){
[1837] Fix | Delete
$option = '<div class="filled-lbl-blk">
[1838] Fix | Delete
<p class="msg">'.esc_attr($need_type).'</p>
[1839] Fix | Delete
<span class="lbl">Change</span>
[1840] Fix | Delete
</div>';
[1841] Fix | Delete
}else{
[1842] Fix | Delete
$option = '<div class="button btn-red">'.esc_attr($label).'</div>';
[1843] Fix | Delete
}
[1844] Fix | Delete
}else if($id=="ampforwp-ux-design-section"){
[1845] Fix | Delete
$opt_med_url = ampforwp_get_setup_info('ampforwp-ux-design-section');
[1846] Fix | Delete
if($opt_med_url!=""){
[1847] Fix | Delete
$option = '<div class="filled-lbl-blk">
[1848] Fix | Delete
<p class="msg">Configured</p>
[1849] Fix | Delete
<span class="lbl">Change</span>
[1850] Fix | Delete
</div>';
[1851] Fix | Delete
}else{
[1852] Fix | Delete
$option = '<div class="button btn-red">'.esc_attr($label).'</div>';
[1853] Fix | Delete
}
[1854] Fix | Delete
}else if($id=="ampforwp-ux-analytics-section"){
[1855] Fix | Delete
$analytics_txt = ampforwp_get_setup_info('ampforwp-ux-analytics-section');
[1856] Fix | Delete
if($analytics_txt!=""){
[1857] Fix | Delete
$option = '<div class="filled-lbl-blk">
[1858] Fix | Delete
<p class="msg">'.esc_attr($analytics_txt).'</p>
[1859] Fix | Delete
<span class="lbl">Change</span>
[1860] Fix | Delete
</div>';
[1861] Fix | Delete
}else{
[1862] Fix | Delete
$option = '<div class="button btn-red">'.esc_attr($label).'</div>';
[1863] Fix | Delete
}
[1864] Fix | Delete
}else{
[1865] Fix | Delete
$option = '<div class="button btn-red">'.esc_attr($label).'</div>';
[1866] Fix | Delete
}
[1867] Fix | Delete
}else{
[1868] Fix | Delete
$option = '<div class="button btn-list">'.esc_attr($label).'</div>';
[1869] Fix | Delete
}
[1870] Fix | Delete
return $option;
[1871] Fix | Delete
}
[1872] Fix | Delete
}
[1873] Fix | Delete
$setup_ids = array(
[1874] Fix | Delete
'ampforwp-ux-website-type-section',
[1875] Fix | Delete
'ampforwp-ux-need-type-section',
[1876] Fix | Delete
'ampforwp-ux-analytics-section'
[1877] Fix | Delete
);
[1878] Fix | Delete
$amp_ux_icon = "amp-ux-warning-okay";
[1879] Fix | Delete
for($sid = 0; $sid < count($setup_ids); $sid++ ){
[1880] Fix | Delete
$check = ampforwp_get_setup_info($setup_ids[$sid]);
[1881] Fix | Delete
if($check==""){
[1882] Fix | Delete
$amp_ux_icon = "amp-ux-warning";
[1883] Fix | Delete
}
[1884] Fix | Delete
}
[1885] Fix | Delete
$is_aafwp = "not-exist";
[1886] Fix | Delete
$aafwp_active_url = '';
[1887] Fix | Delete
$aafwp_default = 0;
[1888] Fix | Delete
$ampforwp_admin_url = admin_url();
[1889] Fix | Delete
$adfwp_a_open = "";
[1890] Fix | Delete
$adfwp_a_close = "";
[1891] Fix | Delete
[1892] Fix | Delete
$adv_data_href = 'data-href=ampforwp-ux-advertisement-section';
[1893] Fix | Delete
if(function_exists('adsforwp_check_plugin')){
[1894] Fix | Delete
$plugin_file = "ads-for-wp/ads-for-wp.php";
[1895] Fix | Delete
$is_sdfwp = "active";
[1896] Fix | Delete
$aafwp_active_url = $ampforwp_admin_url.'admin.php?page=adsforwp&amp;tab=general&amp;reference=ampforwp';
[1897] Fix | Delete
$adfwp_a_open = '<a href="'.esc_url($aafwp_active_url).'" target="_blank">';
[1898] Fix | Delete
$adfwp_a_close = '</a>';
[1899] Fix | Delete
$adv_data_href = 'data-href=';
[1900] Fix | Delete
}
[1901] Fix | Delete
Redux::setSection( $opt_name, array(
[1902] Fix | Delete
'title' => esc_html__( 'Setup', 'accelerated-mobile-pages' ),
[1903] Fix | Delete
'id' => 'ampforwp-new-ux',
[1904] Fix | Delete
'icon' => "el el-warning ux-setup-icon $amp_ux_icon",
[1905] Fix | Delete
'fields' => array(
[1906] Fix | Delete
array(
[1907] Fix | Delete
'id' => 'ampforwp-setup-ux-website-type',
[1908] Fix | Delete
'type' => 'text',
[1909] Fix | Delete
'title' => '',
[1910] Fix | Delete
'default'=>''
[1911] Fix | Delete
)
[1912] Fix | Delete
),
[1913] Fix | Delete
'desc' => '<div class="amp-ux-section">
[1914] Fix | Delete
<h2 class="amp-section-desc">Quick &amp; Easy Setup</h2>
[1915] Fix | Delete
<div class="amp-ux-section-fields">
[1916] Fix | Delete
<div class="amp-ux-section-field" data-id="website-type" data-href="ampforwp-ux-website-type-section">
[1917] Fix | Delete
<div class="amp-ux-elem-field">
[1918] Fix | Delete
<h4 class="amp-ux-elem-title">Website Type</h4>
[1919] Fix | Delete
<div class="amp-ux-elem-but-block amp-ux-valid-require">'.ampforwp_generate_ux_admin_button("ampforwp-ux-website-type-section","button","SELECT").'</div>
[1920] Fix | Delete
</div>
[1921] Fix | Delete
</div>
[1922] Fix | Delete
<div class="amp-ux-section-field" data-href="ampforwp-ux-need-type-section">
[1923] Fix | Delete
<div class="amp-ux-elem-field">
[1924] Fix | Delete
<h4 class="amp-ux-elem-title">
[1925] Fix | Delete
Where do you need AMP?
[1926] Fix | Delete
</h4>
[1927] Fix | Delete
<div class="amp-ux-elem-but-block amp-ux-valid-require">'.ampforwp_generate_ux_admin_button("ampforwp-ux-need-type-section","button","CHOOSE").'</div>
[1928] Fix | Delete
</div>
[1929] Fix | Delete
</div>
[1930] Fix | Delete
<div class="amp-ux-section-field" data-href="ampforwp-ux-design-section">
[1931] Fix | Delete
<div class="amp-ux-elem-field">
[1932] Fix | Delete
<h4 class="amp-ux-elem-title">Design and Presentation</h4>
[1933] Fix | Delete
<div class="amp-ux-elem-but-block">'.ampforwp_generate_ux_admin_button("ampforwp-ux-design-section","button","SET UP").'</div>
[1934] Fix | Delete
</div>
[1935] Fix | Delete
</div>
[1936] Fix | Delete
<div class="amp-ux-section-field" data-href="ampforwp-ux-analytics-section">
[1937] Fix | Delete
<div class="amp-ux-elem-field">
[1938] Fix | Delete
<h4 class="amp-ux-elem-title">Analytics Tracking</h4>
[1939] Fix | Delete
<div class="amp-ux-elem-but-block amp-ux-valid-require">'.ampforwp_generate_ux_admin_button("ampforwp-ux-analytics-section","button","CONFIG").'</div>
[1940] Fix | Delete
</div>
[1941] Fix | Delete
</div>
[1942] Fix | Delete
<div class="amp-ux-section-field" data-href="ampforwp-ux-privacy-section">
[1943] Fix | Delete
<div class="amp-ux-elem-field">
[1944] Fix | Delete
<h4 class="amp-ux-elem-title">Privacy Settings</h4>
[1945] Fix | Delete
<div class="amp-ux-elem-but-block">'.ampforwp_generate_ux_admin_button("ampforwp-ux-privacy-section","button","CHOOSE").'</div>
[1946] Fix | Delete
</div>
[1947] Fix | Delete
</div>'.
[1948] Fix | Delete
$adfwp_a_open.
[1949] Fix | Delete
'<div class="amp-ux-section-field" '.esc_attr($adv_data_href).'>
[1950] Fix | Delete
<div class="amp-ux-elem-field">
[1951] Fix | Delete
<h4 class="amp-ux-elem-title">Advertisement</h4>
[1952] Fix | Delete
<div class="amp-ux-elem-but-block stup">View Setup</div>
[1953] Fix | Delete
</div>
[1954] Fix | Delete
</div>'.
[1955] Fix | Delete
$adfwp_a_close.
[1956] Fix | Delete
'<div class="amp-ux-section-field" data-href="ampforwp-ux-thirdparty-section">
[1957] Fix | Delete
<div class="amp-ux-elem-field">
[1958] Fix | Delete
<h4 class="amp-ux-elem-title">3rd Party Compatibility</h4>
[1959] Fix | Delete
<div class="amp-ux-elem-but-block">'.ampforwp_generate_ux_admin_button("ampforwp-ux-thirdparty-section","label","View List").'</div>
[1960] Fix | Delete
</div>
[1961] Fix | Delete
</div>
[1962] Fix | Delete
</div>
[1963] Fix | Delete
</div>',
[1964] Fix | Delete
));
[1965] Fix | Delete
[1966] Fix | Delete
Redux::setSection( $opt_name, array(
[1967] Fix | Delete
'title' => esc_html__( 'Settings', 'accelerated-mobile-pages' ),
[1968] Fix | Delete
'id' => 'basic',
[1969] Fix | Delete
'icon' => 'el el-cogs',
[1970] Fix | Delete
'desc' => '',
[1971] Fix | Delete
'class' =>'amp-opt-settings',
[1972] Fix | Delete
));
[1973] Fix | Delete
[1974] Fix | Delete
function ampforwp_default_logo_settings($param=""){
[1975] Fix | Delete
$custom_logo_id = '';
[1976] Fix | Delete
$image = '';
[1977] Fix | Delete
$value = '';
[1978] Fix | Delete
$current_page = ampforwp_get_admin_current_page();
[1979] Fix | Delete
if($current_page=="amp_options"){
[1980] Fix | Delete
$custom_logo_id = get_theme_mod( 'custom_logo' );
[1981] Fix | Delete
$image = wp_get_attachment_image_src( $custom_logo_id , 'full');
[1982] Fix | Delete
if( $image ){
[1983] Fix | Delete
return $image[0];
[1984] Fix | Delete
}
[1985] Fix | Delete
}
[1986] Fix | Delete
return $value;
[1987] Fix | Delete
}
[1988] Fix | Delete
function ampforwp_custom_logo_dimensions_options(){
[1989] Fix | Delete
$opCheck = ampforwp_get_setting('ampforwp-custom-logo-dimensions');
[1990] Fix | Delete
if($opCheck==1){
[1991] Fix | Delete
return 'prescribed';
[1992] Fix | Delete
}else{
[1993] Fix | Delete
return 'flexible';
[1994] Fix | Delete
}
[1995] Fix | Delete
}
[1996] Fix | Delete
function ampforwp_get_cpt_generated_post_types() {
[1997] Fix | Delete
$options = '';
[1998] Fix | Delete
$options = get_option('ampforwp_cpt_generated_post_types');
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function