Plugin Directory

Changeset 3396840


Ignore:
Timestamp:
11/17/2025 02:29:48 AM (5 months ago)
Author:
brainywpbd
Message:

AI Summary option added

Location:
minifly
Files:
310 added
5 edited

Legend:

Unmodified
Added
Removed
  • minifly/trunk/assets/css/user-style.css

    r3358243 r3396840  
    7575    color: #9ecbff !important;
    7676}
     77
     78/* AI Summary page CSS goes here */
     79.ai-summary-container {
     80    border: 1px solid #ddd;
     81    border-radius: 8px;
     82    padding: 10px;
     83    background-color: #fff;
     84    display: flex;
     85    flex-direction: column;
     86    justify-content: center;
     87    align-items: center;
     88    gap: 10px;
     89    margin-bottom: 10px;
     90}
     91
     92.ai-summary-container-free {
     93    border: 1px solid #ddd;
     94    border-radius: 8px;
     95    padding: 10px;
     96    background-color: #fff;
     97    display: flex;
     98    flex-direction: row;
     99    justify-content: space-between;
     100    align-items: center;
     101    gap: 10px;
     102    margin-bottom: 10px;
     103}
     104
     105.ai-summary-header p {
     106    font-weight: 600;
     107    margin: 0;
     108    color: #333;
     109    font-size: 16px;
     110}
     111
     112.ai-summary-body {
     113    display: flex;
     114    gap: 8px;
     115}
     116
     117.sapmfly-ai-summary-btn {
     118    display: flex;
     119    align-items: center;
     120    padding: 5px 10px;
     121    background-color: #000;
     122    border: 1px solid #000;
     123    border-radius: 6px;
     124    cursor: pointer;
     125    font-size: 13px;
     126    color: #fff;
     127    gap: 5px;
     128    transition: all 0.3s ease;
     129}
     130
     131.sapmfly-ai-summary-btn-icon {
     132    width: 20px;
     133    height: 20px;
     134}
     135
     136.sapmfly-ai-summary-btn:hover {
     137    background-color: #2c2c2c;
     138    border-color: #2c2c2c;
     139    transform: translateY(-2px);
     140    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
     141}
  • minifly/trunk/minifly.php

    r3390774 r3396840  
    55 * Plugin URI:        https://brainywp.com/minifly/
    66 * Description:       Minifly is your favorite, lightweight companion for better performance. Supercharge your site with tiny tools that make a big difference.
    7  * Version:           1.0.27
     7 * Version:           1.0.28
    88 * Requires at least: 5.2
    99 * Requires PHP:      7.2
     
    6464    }
    6565    // Define constants
    66     define( 'SAPMFLY_VERSION', '0.0.1' );
     66    $plugin_data = get_file_data( __FILE__, array(
     67        'Version' => 'Version',
     68    ) );
     69    define( 'SAPMFLY_VERSION', $plugin_data['Version'] );
    6770    define( 'SAPMFLY_ASSETS', plugin_dir_url( __FILE__ ) . 'assets/' );
    6871    define( 'SAPMFLY_TEMPLATES', plugin_dir_path( __FILE__ ) . 'templates/' );
  • minifly/trunk/readme.txt

    r3390774 r3396840  
    44Requires at least: 5.2
    55Tested up to: 6.8
    6 Stable tag: 1.0.27
     6Stable tag: 1.0.28
    77Requires PHP: 7.2
    88License: GPLv2 or later
     
    4949* **Limit Revision Number** - Keep necessary revision while making database clean is now possible with Minifly. Just toggle on and you will set 5 revisions for post and page. [Minifly pro](https://brainywp.com/minifly/) unlocked you custom post revisions.
    5050* **Maintenance Mood** - You can enable **one click maintenance mood** on your website with our latest quick maintenance mood toggle option.
     51* **AI Post Summary** - You can add AI post summary options in your blogs. So, user can click on ChatGPT, Grok, Google AI, Copilot and see summary of your blog.
    5152
    5253## WordPress white label solution features at Minifly
  • minifly/trunk/templates/user/all-hooks.php

    r3381580 r3396840  
    152152?>
    153153    <button id="sapmfly-dark-mode-toggle"><?php echo esc_html__('🌙 Dark Mode', 'minifly'); ?></button>
    154 <?php
     154    <?php
    155155}
    156156add_action('wp_footer', 'sapmfly_dark_mode_toggle_button');
     
    169169    // Only show on frontend, not for admins or login page
    170170    if ($maintenance_mood === 'yes' && !is_user_logged_in() && !is_admin()) {
    171    
     171
    172172        $file_path = SAPMFLY_TEMPLATES . 'design/maintenance-mood-design.php';
    173173
     
    205205
    206206    $wp_admin_bar->add_node($args);
    207 
    208207}, 100);
     208
     209// AI post summary related code
     210add_filter('the_content', 'minifly_ai_summary_prepend');
     211function minifly_ai_summary_prepend($content)
     212{
     213
     214    // Only run on single blog posts
     215    if (is_single() && get_post_type() == 'post') {
     216
     217        // Get your saved option
     218        $ai_summary = get_option('sapmfly_ai_summary');
     219
     220        // If enabled, add your div at the top
     221        if ($ai_summary === 'yes') {
     222
     223            // Get template output
     224            ob_start();
     225            include SAPMFLY_TEMPLATES . 'user/features/post-ai-summary-front.php';
     226            $extra_div = ob_get_clean();
     227
     228            return $extra_div . $content; // prepend to post content
     229        }
     230    }
     231
     232    return $content;
     233}
     234
     235
     236$ai_summary = get_option('sapmfly_ai_summary');
     237
     238if ($ai_summary === 'yes') {
     239    add_action('wp_footer', 'minifly_ai_summary_btn_handler');
     240}
     241
     242function minifly_ai_summary_btn_handler()
     243{
     244    // Shudhu matro single blog post page-ei script-ta load hobe
     245    if (is_single() && get_post_type() === 'post') {
     246    ?>
     247        <script>
     248            document.addEventListener('DOMContentLoaded', function() {
     249
     250                // Current post URL
     251                let postUrl = window.location.href;
     252
     253                // Common prompt
     254                let prompt = "Visit this URL " + postUrl + " and provide a summary of the blog post. Include the key points, and if there are any statistics mentioned, include those as well.";
     255                let encodedPrompt = encodeURIComponent(prompt);
     256
     257                // --- CHATGPT ---
     258                const chatGPTSummary = document.getElementById('sapmfly-ai-summary--chatgpt');
     259                if (chatGPTSummary) {
     260                    chatGPTSummary.addEventListener('click', function() {
     261                        let url = "https://chatgpt.com/?prompt=" + encodedPrompt;
     262                        window.open(url, "_blank", "noopener,noreferrer");
     263                    });
     264                }
     265
     266                // --- GEMINI ---
     267                const geminiSummary = document.getElementById('sapmfly-ai-summary--gemini');
     268                if (geminiSummary) {
     269                    geminiSummary.addEventListener('click', function() {
     270                        let url = "https://google.com/search?udm=50&aep=11&q=" + encodedPrompt;
     271                        window.open(url, "_blank", "noopener,noreferrer");
     272                    });
     273                }
     274
     275                // --- Bing ---
     276                const bingSummary = document.getElementById('sapmfly-ai-summary--bing');
     277                if (bingSummary) {
     278                    bingSummary.addEventListener('click', function() {
     279                        let url = "https://www.bing.com/copilotsearch?q=" + encodedPrompt + "&showconv=1";
     280                        window.open(url, "_blank", "noopener,noreferrer");
     281                    });
     282                }
     283
     284                // --- GROK ---
     285                const grokSummary = document.getElementById('sapmfly-ai-summary--grok');
     286                if (grokSummary) {
     287                    grokSummary.addEventListener('click', function() {
     288                        let url = "https://grok.com/?q=" + encodedPrompt;
     289                        window.open(url, "_blank", "noopener,noreferrer");
     290                    });
     291                }
     292
     293                // --- PERPLEXITY ---
     294                const perplexitySummary = document.getElementById('sapmfly-ai-summary-btn--perplexity');
     295                if (perplexitySummary) {
     296                    perplexitySummary.addEventListener('click', function() {
     297                        let url = "https://www.perplexity.ai/search?q=" + encodedPrompt;
     298                        window.open(url, "_blank", "noopener,noreferrer");
     299                    });
     300                }
     301
     302            });
     303        </script>
     304<?php
     305    }
     306}
  • minifly/trunk/templates/user/user-setup.php

    r3380713 r3396840  
    4343            update_option('sapmfly_maintenance_mood', $maintenance_mood);
    4444
     45            $ai_summary = isset($_POST['sapmfly_ai_summary']) ? 'yes' : 'no';
     46            update_option('sapmfly_ai_summary', $ai_summary);
     47
    4548            $global_toggle_value = isset($_POST['sapmfly_widgets_toggle']) ? 'yes' : 'no';
    4649            update_option('sapmfly_widgets_toggle', $global_toggle_value);
     
    5861    $hide_toolbar_user = get_option('sapmfly_hide_toolbar_user', 'no');
    5962    $maintenance_mood = get_option('sapmfly_maintenance_mood', 'no');
     63    $ai_summary = get_option('sapmfly_ai_summary', 'no');
    6064
    6165    // Save global save option
     
    158162                                    ?>
    159163
     164
    160165                                    <!-- Enable enable maintenance mood -->
    161166                                    <?php
     
    163168                                    if (file_exists($sapmfly_enable_maintenance)) {
    164169                                        require_once $sapmfly_enable_maintenance;
     170                                    }
     171                                    ?>
     172
     173                                    <!-- Enable dark mood for back end -->
     174                                    <?php
     175                                    $sapmfly_ai_summary_btn = SAPMFLY_TEMPLATES . 'user/features/post-ai-summary.php';
     176                                    if (file_exists($sapmfly_ai_summary_btn)) {
     177                                        require_once $sapmfly_ai_summary_btn;
    165178                                    }
    166179                                    ?>
Note: See TracChangeset for help on using the changeset viewer.