'array', 'sanitize_callback' => ['\ShareMyPost\Helpers', 'sanitize_settings'], 'default' => [], ]); } static function add_admin_menu() { $icon = 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIj48c3R5bGU+LnMwIHsgZmlsbDogIzYzNjZmMSB9IC5zMSB7IGZpbGw6ICNmZmZmZmYgfTwvc3R5bGU+PGcgaWQ9IkxheWVyIDEiPjxwYXRoIGNsYXNzPSJzMCIgZD0ibTE2MyAwaDY5OGM5MC4wMiAwIDE2MyA3Mi45OCAxNjMgMTYzdjY5OGMwIDkwLjAyLTcyLjk4IDE2My0xNjMgMTYzaC02OThjLTkwLjAyIDAtMTYzLTcyLjk4LTE2My0xNjN2LTY5OGMwLTkwLjAyIDcyLjk4LTE2MyAxNjMtMTYzeiIvPjxnPjxwYXRoIGlkPSJtYXJrIiBjbGFzcz0iczEiIGQ9Im02MjAuNyAxNDYuNmgxNDguOWM2LjggMCAxMS44IDUuMiAxMS44IDExLjh2MTU1LjZjMCA1LjUtMi45IDguMi03LjQgNy45bC01MC41LTQ5LjljLTIzLjUgMjMtNTUuNSA0NC05Ny41IDUwaC0xOTFjLTE3LjM3IDAtMzQuMDMgNi45LTQ2LjMyIDE5LjE4LTEyLjI4IDEyLjI5LTE5LjE4IDI4Ljk1LTE5LjE4IDQ2LjMyIDAgMTcuMzcgNi45IDM0LjAzIDE5LjE4IDQ2LjMyIDEyLjI5IDEyLjI4IDI4Ljk1IDE5LjE4IDQ2LjMyIDE5LjE4aDE3OC4yYzQyLjY5IDEwLjk4IDgwLjIgMzYuNTQgMTA2LjA0IDcyLjI1IDI1Ljg0IDM1LjcxIDM4LjM4IDc5LjMyIDM1LjQ2IDEyMy4zMS0yLjkyIDQzLjk4LTIxLjExIDg1LjU2LTUxLjQ1IDExNy41NC0zMC4zMyAzMS45OC03MC44OCA1Mi4zNi0xMTQuNjUgNTcuNmgtMzIyLjZjLTcuNS0wLjItMTIuMy0zLjItMTIuMS04LjcgOC4xLTQzIDQyLjEtOTkgMTE4LjEtMTEyLjVoMTk0YzE3LjY0IDAgMzQuNTUtNy4wMSA0Ny4wMi0xOS40OCAxMi40Ny0xMi40NyAxOS40OC0yOS4zOCAxOS40OC00Ny4wMiAwLTE3LjY0LTcuMDEtMzQuNTUtMTkuNDgtNDcuMDItMTIuNDctMTIuNDctMjkuMzgtMTkuNDgtNDcuMDItMTkuNDhoLTEzMWMtNDguMjcgMC05NC41Ni0xOS4xNy0xMjguNjktNTMuMzEtMzQuMTQtMzQuMTMtNTMuMzEtODAuNDItNTMuMzEtMTI4LjY5IDAtNDguMjcgMTkuMTctOTQuNTYgNTMuMzEtMTI4LjY5IDM0LjEzLTM0LjE0IDgwLjQyLTUzLjMxIDEyOC42OS01My4zMWgxOTVjNy0xLjUgMTYtNi41IDIxLjctMTEuM2wtMzMuNC0zNi42Yy0zLTMtMi4zLTguMSAyLjQtMTF6Ii8+PC9nPjwvZz48L3N2Zz4='; add_menu_page( 'ShareMyPost', 'ShareMyPost', 'manage_options', 'sharemypost', '\ShareMyPost\Admin::dispatcher', $icon); } static function dispatcher() { echo '
'; self::render_header(); echo '
'; self::render_options_layout(); echo '
'; echo '
'; } static function render_header() { if (defined('SHAREMYPOST_PRO_VERSION')) { $sub_tabs = [ 'inline_content' => ['label' => 'Inline Content', 'icon' => 'menu'], 'floating_bar' => ['label' => 'Floating Bar', 'icon' => 'align-pull-left', 'pro' => true], 'custom_networks' => ['label' => 'Custom Networks', 'icon' => 'networking', 'pro' => true], 'click_to_tweet' => ['label' => 'Click to X', 'pro' => true], 'configuration' => ['label' => 'Configuration', 'icon' => 'admin-settings', 'pro' => true], 'support' => ['label' => 'Support', 'icon' => 'sos'], 'license' => ['label' => 'License', 'icon' => 'admin-network'], ]; } else { $sub_tabs = [ 'inline_content' => ['label' => 'Inline Content', 'icon' => 'menu'], 'support' => ['label' => 'Support', 'icon' => 'sos'], 'go_pro' => ['label' => 'Go Pro', 'icon' => 'lock'], ]; } echo '
'; $icon = ''; foreach($sub_tabs as $slug => $tab){ if ($slug === 'click_to_tweet') { $icon = ' '; } elseif (!empty($tab['icon'])) { $icon = ' '; } $pro_tag = (!defined('SHAREMYPOST_PRO_VERSION') && !empty($tab['pro'])) ? 'PRO' : ''; echo ''; } echo '
v' . esc_html(SHAREMYPOST_VERSION) . '
'; } static function render_options_layout() { if (defined('SHAREMYPOST_PRO_VERSION')) { $sub_tabs = [ 'inline_content' => ['label' => 'Inline Content'], 'floating_bar' => ['label' => 'Floating Bar', 'pro' => true], 'custom_networks' => ['label' => 'Custom Networks', 'pro' => true], 'click_to_tweet' => ['label' => 'Click to X', 'pro' => true], 'configuration' => ['label' => 'Configuration', 'pro' => true], 'support' => ['label' => 'Support'], 'license' => ['label' => 'License', 'pro' => true], ]; } else { $sub_tabs = [ 'inline_content' => ['label' => 'Inline Content'], 'support' => ['label' => 'Support'], 'go_pro' => ['label' => 'Go Pro'], ]; } echo '
'; foreach ($sub_tabs as $slug => $tab) { $style = ($slug === 'inline_content') ? '' : 'display:none;'; echo '
'; if($slug === 'custom_networks'){ do_action('sharemypost_custom_networks_settings'); } elseif($slug === 'floating_bar'){ do_action('sharemypost_floating_bar_settings'); } elseif($slug === 'license'){ do_action('sharemypost_render_license_page'); } elseif($slug === 'support'){ self::support_page(); } elseif($slug === 'go_pro'){ self::go_pro_page(); } else { $method = $slug . '_settings'; if(method_exists('\ShareMyPost\Settings\UI', $method)){ \ShareMyPost\Settings\UI::$method(); } } echo '
'; } echo '
'; } static function enqueue_admin_assets($hook) { if(false === strpos($hook, 'sharemypost')){ return; } wp_enqueue_style('sharemypost-admin', SHAREMYPOST_PLUGIN_URL . 'assets/css/admin.css', [], SHAREMYPOST_VERSION); wp_enqueue_media(); wp_enqueue_script('sharemypost-admin', SHAREMYPOST_PLUGIN_URL . 'assets/js/admin.js', ['jquery', 'jquery-ui-sortable'], SHAREMYPOST_VERSION, true); wp_localize_script('sharemypost-admin', 'sharemypost_data', [ 'nonce' => wp_create_nonce('sharemypost_admin_nonce'), 'ajax_url' => admin_url('admin-ajax.php'), 'is_pro' => defined('SHAREMYPOST_PRO_VERSION') ]); } static function support_page(){ echo '
' . esc_html('sharemypost logo', 'sharemypost') . '

' . esc_html__('Help & Support', 'sharemypost') . '

' . esc_html__('You can contact the ShareMyPost team via email at ', 'sharemypost') . 'support@sharemypost.net ' . esc_html__('or through our Support Ticket System.', 'sharemypost') . '

' . esc_html__('You can also check the documentation here:', 'sharemypost') . ' https://sharemypost.net/docs

'; } static function go_pro_page(){ echo '

' . esc_html__('Upgrade to ShareMyPost PRO', 'sharemypost') . '

' . esc_html__('Unlock advanced sharing features, deep tracking analytics, AI tools, and premium support.', 'sharemypost') . '

' . esc_html__('Get ShareMyPost Pro Now', 'sharemypost') . '

' . esc_html__('Advanced Analytics & Tracking', 'sharemypost') . '

' . esc_html__('Seamless Google Analytics 4 (GA4) integration and customizable dynamic UTM tracking parameters to measure your viral loops.', 'sharemypost') . '

' . esc_html__('Universal Modal Sharing', 'sharemypost') . '

' . esc_html__('Add a single universal share button that triggers a stunning modal listing all 30+ networks, keeping your layout clean.', 'sharemypost') . '

' . esc_html__('Click to X (Twitter) Shortcode', 'sharemypost') . '

' . esc_html__('Create high-converting callout boxes within your content using customizable themes, accents, and custom pre-written tweets.', 'sharemypost') . '

' . esc_html__('AI Sharing Integration', 'sharemypost') . '

' . esc_html__('Enable one-click sharing/prompting to popular AI assistants like ChatGPT, Gemini, Claude, Perplexity, and Grok.', 'sharemypost') . '

' . esc_html__('Advanced Customization', 'sharemypost') . '

' . esc_html__('Unlock 6 button shapes, 5 button styles, adjustable custom sizes, margins, custom colors, and custom network icons.', 'sharemypost') . '

' . esc_html__('Floating Share Bars', 'sharemypost') . '

' . esc_html__('Add sticky side bars that follow visitors as they scroll, fully customizable in behavior and device visibility.', 'sharemypost') . '

'; } }