Plugin Directory

Changeset 3209746


Ignore:
Timestamp:
12/18/2024 10:04:10 AM (14 months ago)
Author:
obmarketingtech
Message:

tagging version 1.0.4

Location:
outbrain-feed/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • outbrain-feed/trunk/includes/Admin.php

    r3209068 r3209746  
    99    public function add_admin_menu() {
    1010        add_menu_page(
    11             esc_html__('Outbrain Feed Settings', 'outbrain-feed'), // Escaping the title
    12             esc_html__('Outbrain Feed','outbrain-feed'), // Escaping the menu title
     11            __('Outbrain Feed Settings', OBFEED_TEXT_DOMAIN),
     12            __('Outbrain Feed', OBFEED_TEXT_DOMAIN),
    1313            'manage_options',
    1414            'outbrain-feed',
     
    2222
    2323        echo '<div class="wrap">';
    24         // Use esc_html__() for safe output
    25         echo '<h1>' . esc_html__('Outbrain Feed Settings', 'outbrain-feed') . '</h1>';
     24        echo '<h1>' . __('Outbrain Feed Settings', OBFEED_TEXT_DOMAIN) . '</h1>';
    2625
    2726        if ($mode === 'basic') {
    28             // Use esc_html__() for safe output
    29             echo '<p>' . esc_html__('Outbrain Feed plugin was successfully installed and set up. This means that the Outbrain default widget (identified by Widget-ID GS_1) will be automatically injected at the end of each article/post and will be applied to all platforms—desktop and mobile.', 'outbrain-feed') . '</p>';
    30             echo '<p>' . esc_html__('Note: A new version of this plugin is planned to be released by the end of 2024. The new version will support advanced capabilities, such as the setup of multiple ad insertion rules utilizing different Widget-IDs and the possibility to control the platform (desktop or mobile) to which the widget applies.', 'outbrain-feed') . '</p>';
     27            echo '<p>' . __('Outbrain Feed plugin was successfully installed and set up. This means that the Outbrain default widget (identified by Widget-ID GS_1) will be automatically injected at the end of each article/post and will be applied to all platforms—desktop and mobile.', OBFEED_TEXT_DOMAIN) . '</p>';
     28            echo '<p>' . __('Note: A new version of this plugin is planned to be released by the end of 2024. The new version will support advanced capabilities, such as the setup of multiple ad insertion rules utilizing different Widget-IDs and the possibility to control the platform (desktop or mobile) to which the widget applies.', OBFEED_TEXT_DOMAIN) . '</p>';
    3129        } else {
    32             // For static strings not requiring translation or dynamic data, directly escape the output.
    33             echo '<p>' . esc_html__('Advanced options will be available in future updates.', 'outbrain-feed') . '</p>';
     30            // Placeholder for Advanced mode functionality
     31            echo '<p>Advanced options will be available in future updates.</p>';
    3432        }
    3533
  • outbrain-feed/trunk/includes/DB.php

    r3209381 r3209746  
    2727        dbDelta($sql);
    2828
    29         $wpdb->insert(
    30             $table_name,
    31             array(
    32                 'widget_id' => 'GS_1',
    33                 'placement' => 'after_post',
    34                 'external_id' => 'ob-wordpress-plugin-v1-0'
    35             )
    36         );
     29        // Insert default ad snippet
     30        $wpdb->insert($table_name, [
     31            'widget_id' => 'GS_1',
     32            'placement' => 'after_post',
     33            'external_id' => 'ob-wordpress-plugin-v1-0'
     34        ]);
    3735
    3836        // Save default mode in wp_options
  • outbrain-feed/trunk/includes/Frontend.php

    r3209381 r3209746  
    88        $this->db = new DB();
    99        add_filter('the_content', [$this, 'inject_ad_content']);
    10         add_action('wp_enqueue_scripts', [$this, 'enqueue_outbrain_script']);
    1110    }
    1211
     
    1615        global $wpdb;
    1716        $table_name = $wpdb->prefix . 'obfeed_snippets';
    18 
    19         $snippet = $wpdb->get_row("SELECT * FROM `{$table_name}` LIMIT 1");
     17        $snippet = $wpdb->get_row("SELECT * FROM $table_name LIMIT 1");
    2018
    2119        if ($snippet) {
    22             $ad_code = '<div class="OUTBRAIN" data-widget-id="' . esc_attr($snippet->widget_id) . '" data-external-id="' . esc_attr($snippet->external_id) . '" data-src="' . esc_url(get_permalink()) . '"></div>';
     20            $ad_code = '<div class="OUTBRAIN" data-widget-id="' . esc_attr($snippet->widget_id) . '" data-external-id="' . esc_attr($snippet->external_id) . '" data-src="' . esc_url(get_permalink()) . '"></div>
     21                        <script type="text/javascript" async src="https://widgets.outbrain.com/outbrain.js"></script>';
    2322            $content .= $ad_code;
    2423        }
     
    2625        return $content;
    2726    }
    28 
    29     public function enqueue_outbrain_script() {
    30         if (is_single()) { // Only enqueue the script on single post pages
    31             wp_enqueue_script(
    32                 'outbrain-widgets',
    33                 'https://widgets.outbrain.com/outbrain.js',
    34                 array(),
    35                 time(), // Use the plugin version
    36                 true
    37             );
    38         }
    39     }
    4027}
  • outbrain-feed/trunk/outbrain-feed.php

    r3209412 r3209746  
    44 * Plugin URI: https://developer.outbrain.com/outbrain-wordpress-implementation-guide/
    55 * Description: Dynamically inserts Outbrain feed widgets into articles, with flexible configuration.
    6  * Version: 1.0.3
     6 * Version: 1.0.4
    77 * Author: Outbrain Dev Team
    88 * Author URI:
  • outbrain-feed/trunk/readme.txt

    r3209412 r3209746  
    44Requires at least: 6.1
    55Tested up to: 6.7
    6 Stable tag: 1.0.3
     6Stable tag: 1.0.4
    77Requires PHP: 7.1
    88License: GPLv2 or later
  • outbrain-feed/trunk/uninstall.php

    r3209068 r3209746  
    55
    66// Remove plugin options and custom tables
    7 delete_option('obfeed_settings');
    87global $wpdb;
    98$table_name = $wpdb->prefix . 'obfeed_snippets';
     
    1312// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange
    1413$wpdb->query("DROP TABLE IF EXISTS `{$table_name}`");
     14
     15delete_option('obfeed_plugin_mode');
     16delete_option('obfeed_plugin_status');
Note: See TracChangeset for help on using the changeset viewer.