Plugin Directory

Changeset 3040499

Timestamp:
02/24/2024 06:32:49 AM (5 months ago)
Author:
Atlas_Gondal
Message:

v2.1 with author selection simplified and few other refinements

Location:
export-media-urls/trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • export-media-urls/trunk/classes/class-export-media-urls-admin.php

    r2994472 r3040499  
    4646        delete_transient('export_media_urls_activation_redirect');
    4747
    48         wp_safe_redirect(add_query_arg(array('page' => 'extract-media-urls-settings'), admin_url('tools.php')));
     48        wp_safe_redirect(add_query_arg(array('page' => ), admin_url('tools.php')));
    4949    }
    5050
     
    5555            'Export Media URLs',
    5656            'Export Media URLs',
    57             'manage_options',
    58             'extract-media-urls-settings',
     57            ,
     58            ,
    5959            array($this, 'emu_settings_page')
    6060        );
     
    7272    }
    7373
    74     public function enqueue_scripts()
    75     {
    76         wp_enqueue_style('emu_style', plugin_dir_url(__FILE__) . '../assets/css/style.css', array(), '1.0.0', 'all');
     74    public function enqueue_scripts($hook_suffix)
     75    {
     76
     77        if($hook_suffix !== Constants::PLUGIN_HOOK_SUFFIX) {
     78            return;
     79        }
     80
     81        wp_enqueue_style('emu_style', plugin_dir_url(__FILE__) . '../assets/css/style.css', array(), '2.1', 'all');
     82
     83        if (!wp_script_is('select2', 'registered')) {
     84            wp_register_script('select2', plugin_dir_url(__FILE__) . '../assets/js/select2.min.js', array('jquery'), '4.0.13', true);
     85            wp_register_style('select2css', plugin_dir_url(__FILE__) . '../assets/css/select2.min.css', false, '4.0.13', 'all');
     86        }
     87
     88        if (!wp_script_is('select2', 'enqueued')) {
     89            wp_enqueue_script('select2');
     90            wp_enqueue_style('select2css');
     91        }
     92       
     93        wp_enqueue_script('emu_script', plugin_dir_url(__FILE__) . '../assets/js/script.js', array('jquery', 'select2'), '2.1', true);
    7794    }
    7895
    7996    public function emu_settings_page()
    8097    {
    81         if (!current_user_can('manage_options')) {
     98        if (!current_user_can()) {
    8299            wp_die(esc_html__('You do not have sufficient permissions to access this page.', Constants::PLUGIN_TEXT_DOMAIN));
    83100        }
     
    136153
    137154                                <tr>
    138 
    139                                     <th><label>By Author:</label></th>
    140 
     155                                    <th><label for="post-author">By Author:</label></th>
    141156                                    <td>
    142 
    143                                         <label><input type="radio" name="post-author" checked value="all" required="required" /> All</label><br />
    144                                         <?php
    145 
    146                                         if (!empty($user_ids) && !empty($user_names)) {
    147                                             for ($i = 0; $i < count($user_ids); $i++) {
    148                                                 echo '<label><input type="radio" name="post-author" value="' . $user_ids[$i] . '" required="required" /> ' . $user_names[$i] . '</label><br>';
     157                                        <select id="post-author" class="select2" name="post-author" required="required" style="width: 40%;">
     158                                        >
     159                                        <?php
     160                                            if (!empty($user_ids) && !empty($user_names)) {
     161                                        ) {
     162                                           
     163                                               
    149164                                            }
    150                                         }
    151                                         ?>
    152 
     165                                            ?>
     166                                        </select>
    153167                                    </td>
    154 
    155168                                </tr>
     169
    156170
    157171                                <tr>
     
    242256                    $additional_data = $_POST['additional-data'];
    243257                    $post_author = $_POST['post-author'];
     258
    244259                    $export_type = $_POST['export-type'];
    245260
     
    273288        $current_screen = get_current_screen();
    274289
    275         if ($current_screen && false !== strpos($current_screen->id, 'extract-media-urls-settings')) {
     290        if ($current_screen && false !== strpos($current_screen->id, )) {
    276291            return true;
    277292        } else {
  • export-media-urls/trunk/classes/constants.php

    r2994472 r3040499  
    88{
    99    public const PLUGIN_NAME = 'Export Media URLs';
    10     public const PLUGIN_VERSION = '2.0';
     10    public const PLUGIN_VERSION = '2.';
    1111    public const PLUGIN_SLUG = 'export-media-urls';
    1212    public const PLUGIN_FILE = 'export-media-urls/export-media-urls.php';
     
    1919    public const PLUGIN_TEXT_DOMAIN = 'export-media-urls';
    2020    public const PLUGIN_SETTINGS_PAGE_CAPABILITY = 'manage_options';
    21     public const PLUGIN_SETTINGS_PAGE_SLUG = 'extract-media-urls-settings';
     21    public const PLUGIN_SETTINGS_PAGE_SLUG = 'export-media-urls-settings';
     22    public const PLUGIN_HOOK_SUFFIX = 'tools_page_export-media-urls-settings';
    2223}
  • export-media-urls/trunk/export-media-urls.php

    r2994472 r3040499  
    55 * Plugin URI:  https://wordpress.org/plugins/export-media-urls/
    66 * Description: This plugin allows you to extract all URLs of your media, along with title, date, and type. It supports writing output in CSV file, or you can view URLs within the dashboard. It can be very useful during migration, seo analysis and security audit.
    7  * Version:     2.0
     7 * Version:     2.
    88 * Author:      Atlas Gondal
    99 * Author URI:  https://AtlasGondal.com/
     
    1616
    1717/*
    18     Copyright (c) 2020- Atlas Gondal (contact : https://atlasgondal.com/contact-me/)
    19     This program is free software; you can redistribute it and/or modify
    20     it under the terms of the GNU General Public License as published by
    21     the Free Software Foundation; version 2 of the License.
     18Copyright (c) 2020- Atlas Gondal (contact : https://atlasgondal.com/contact-me/)
     19This program is free software; you can redistribute it and/or modify
     20it under the terms of the GNU General Public License as published by
     21the Free Software Foundation; version 2 of the License.
    2222
    23     This program is distributed in the hope that it will be useful,
    24     but WITHOUT ANY WARRANTY; without even the implied warranty of
    25     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    26     GNU General Public License for more details.
     23This program is distributed in the hope that it will be useful,
     24but WITHOUT ANY WARRANTY; without even the implied warranty of
     25MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     26GNU General Public License for more details.
    2727
    2828 */
  • export-media-urls/trunk/readme.txt

    r2994477 r3040499  
    44Tags: export media urls, media links, extract media urls, export, utilities, export, csv
    55Requires at least: 3.1
    6 Tested up to: 6.4.1
     6Tested up to: 6.4.
    77Stable tag: 5.9
    88Requires PHP: 5.4
     
    141141== Changelog ==
    142142
     143
     144
     145
     146
     147
     148
     149
     150
     151
     152
     153
     154
    143155= 2.0 =
    144156* Added - additional data fields (file name, caption, alt-text, description)
     
    155167== Upgrade Notice ==
    156168
    157 = 2.0 =
    158 
    159 * Added - additional data fields (file name, caption, alt-text, description)
    160 * Added - enables user to delete the file once downloaded
    161 * Added - support for the translation
    162 * Fixed - patched a security vulnerability
    163 * Improvement - a few code refinements and validation checks
    164 * Compatibility - tested with wordpress 6.4.1 & PHP 8.2.0
     169= 2.1 =
     170* Improvement - author filtering is simplified
     171* Compatibility - tested with wordpress 6.4.3
Note: See TracChangeset for help on using the changeset viewer.