Plugin Directory

Changeset 3348892


Ignore:
Timestamp:
08/23/2025 07:59:33 AM (5 months ago)
Author:
dartiss
Message:

Version 1.2

Location:
shareopenly/tags/1.2
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • shareopenly/tags/1.2/inc/add-sharing-link.php

    r3137746 r3348892  
    3434            $url = home_url( add_query_arg( array(), $wp->request ) );
    3535
    36             $content .= '<div class="shareopenly"><img src="https://shareopenly.org/images/logo.svg" alt="ShareOpenly logo">&nbsp;<a href="https://shareopenly.org/share/?url=' . $url . '&text=' . $title . '">' . $settings['text'] . '</a></div>';
     36            $content .= '<div class="shareopenly"><img src="' . esc_url( plugins_url( '../images/logo.svg', __FILE__ ) ) . '" alt="" referrerpolicy="no-referrer">&nbsp;<a href="https://shareopenly.org/share/?url=' . $url . '&text=' . $title . '" loading="lazy" decoding="async" aria-hidden="true" />' . esc_html( $settings['text'] ) . '</a></div>';
    3737        }
    3838    }
  • shareopenly/tags/1.2/inc/settings.php

    r3137746 r3348892  
    55 * Assorted functions to add and create settings.
    66 *
    7  * @package plugin-slug
     7 * @package shareopenly
    88 */
    99
     
    3232    if ( ! $settings['text'] ) {
    3333        $settings['text'] = __( 'Share this post on social media.', 'shareopenly' );
     34        add_option( 'shareopenly_text', $settings['text'] );
    3435    }
    3536
     
    3940    if ( ! $settings['priority'] ) {
    4041        $settings['priority'] = 10;
     42        add_option( 'shareopenly_priority', $settings['priority'] );
    4143    }
    4244
     
    6870                break;
    6971        }
     72    }
     73
     74    // If the post types have changed, make sure to upate them.
     75    if ( $support_post_types !== $shareopenly_post_types ) {
     76        add_option( 'shareopenly_type', $shareopenly_post_types );
    7077    }
    7178
     
    110117 * Type setting callback
    111118 *
    112  * Output the settings fields for selecting on which post types to display sharing link.
     119 * Output the settings fields for selecting which post types to display sharing link.
    113120 */
    114121function shareopenly_type_callback() {
     
    121128        <?php foreach ( $post_types as $post_type ) : ?>
    122129            <li>
    123                 <input type="checkbox" id="shareopenly_type_<?php echo esc_attr( $post_type->name ); ?>" name="shareopenly_type[]" value="<?php echo esc_attr( $post_type->name ); ?>" <?php echo checked( in_array( $post_type->name, $support_post_types, true ) ); ?> />
    124                 <label for="shareopenly_type_<?php echo esc_attr( $post_type->name ); ?>"><?php echo esc_html( $post_type->label ); ?></label>
     130                <input type="checkbox" id="shareopenly_type_<?php echo esc_html( $post_type->name ); ?>" name="shareopenly_type[]" value="<?php echo esc_html( $post_type->name ); ?>" <?php echo checked( in_array( $post_type->name, $support_post_types, true ) ); ?> />
     131                <label for="shareopenly_type_<?php echo esc_html( $post_type->name ); ?>"><?php echo esc_html( $post_type->label ); ?></label>
    125132            </li>
    126133        <?php endforeach; ?>
     
    140147    $text    = $options['text'];
    141148
    142     echo '<input name="shareopenly_text" size="40" type="text" value="' . esc_attr( $text ) . '" />';
     149    echo '<input name="shareopenly_text" size="40" type="text" value="' . esc_html( $text ) . '" /><label for="shareopenly_text">' . esc_html( 'The sharing text that will be displayed' ) . '</label>';
    143150}
    144151
     
    153160    $type    = $options['priority'];
    154161
    155     echo '<input name="shareopenly_priority" size="4" maxlength="4" type="text" value="' . esc_attr( $type ) . '" />';
     162    echo '<input name="shareopenly_priority" min="1" max="9999" type="number" value="' . esc_html( $type ) . '" /><label for="shareopenly_text">' . esc_html( 'The priority of the sharing message on the page' ) . '</label>';
    156163}
  • shareopenly/tags/1.2/inc/shared.php

    r3137746 r3348892  
    6969
    7070/**
    71  * WordPress Fork Check
     71 * WordPress Requirements Check
    7272 *
    73  * Deactivate the plugin if an unsupported fork of WordPress is detected.
     73 * Deactivate the plugin if certain requirements are not met.
    7474 *
    75  * @version 1.0
     75 * @version 1.2
    7676 */
    77 function shareopenly_fork_check() {
     77function shareopenly_requirements_check() {
     78
     79    $reason = '';
     80
     81    // Grab the plugin details.
     82
     83    $plugins = get_plugins();
     84    $name    = $plugins[ SHAREOPENLY_PLUGIN_BASE ]['Name'];
    7885
    7986    // Check for a fork.
    8087
    81     if ( function_exists( 'calmpress_version' ) || function_exists( 'classicpress_version' ) ) {
     88    if ( function_exists( 'calmpress_version' ) || function_exists( 'classicpress_version' ) || defined( 'COSMIC_VERSION' ) ) {
    8289
    83         // Grab the plugin details.
     90        /* translators: 1: The plugin name. */
     91        $reason .= '<li>' . sprintf( __( 'A fork of WordPress was detected. %1$s has not been tested on this fork and, as a consequence, the author will not provide any support.', 'shareopenly' ), $name ) . '</li>';
    8492
    85         $plugins = get_plugins();
    86         $name    = $plugins[ SHAREOPENLY_PLUGIN_BASE ]['Name'];
     93    }
     94
     95    // If a requirement is not met, output the message and stop the plugin.
     96
     97    if ( '' !== $reason ) {
    8798
    8899        // Deactivate this plugin.
     
    93104
    94105        /* translators: 1: The plugin name. */
    95         $message = '<p><b>' . sprintf( __( '%1$s has been deactivated', 'shareopenly' ), $name ) . '</b></p><p>' . __( 'Reason:', 'shareopenly' ) . '</p>';
    96         /* translators: 1: The plugin name. */
    97         $message .= '<ul><li>' . __( 'A fork of WordPress was detected.', 'shareopenly' ) . '</li></ul><p>' . sprintf( __( 'The author of %1$s will not provide any support until the above are resolved.', 'shareopenly' ), $name ) . '</p>';
     106        $message = '<p><b>' . sprintf( __( '%1$s has been deactivated', 'shareopenly' ), $name ) . '</b></p><p>' . __( 'Reason:', 'shareopenly' ) . '</p><ul>' . $reason . '</ul>';
    98107
    99108        $allowed = array(
     
    108117}
    109118
    110 add_action( 'admin_init', 'shareopenly_fork_check' );
     119add_action( 'admin_init', 'shareopenly_requirements_check' );
  • shareopenly/tags/1.2/readme.txt

    r3271373 r3348892  
    22Contributors: dartiss, jeherve, mediaformat
    33Donate link: https://artiss.blog/donate
    4 Tags: share, sharing, social media, mastodon, threads
     4Tags: share, openly, social media, mastodon, threads
    55Requires at least: 4.6
    66Tested up to: 6.8
    77Requires PHP: 8.0
    8 Stable tag: 1.1
     8Stable tag: 1.2
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1111README revision: 1.0
    1212
    13 The official plugin for [ShareOpenly](https://shareopenly.org/) - adding modern, open social media sharing links to your website.
     13The official plugin for [ShareOpenly](https://shareopenly.org/) - adding modern, open social media sharing links to your website. Share openly.
    1414
    1515== Description ==
    1616
    17 You know all those “share to Facebook” / “share to Twitter” links you see all over peoples’ websites? They’re all out of date.
     17You know all those "share to Facebook" / "share to Twitter" links you see all over peoples’ websites? They’re all out of date.
    1818
    19 Social media has evolved over the last year, yet nobody has “share to” links for Mastodon, Bluesky, Threads, etc. There have been a few attempts to create “share to Mastodon” buttons, but they haven’t taken the larger breadth of the new social media landscape into account.
     19Social media has evolved over the last year, yet nobody has "share to" links for Mastodon, Bluesky, Threads, etc. There have been a few attempts to create "share to Mastodon" buttons, but they haven’t taken the larger breadth of the new social media landscape into account.
    2020
    2121This is where ShareOpenly comes in.
    2222
    23 Activate this plugin and, at the bottom of every post and/or page on your site, you’ll see a “share to social media” button. If you click it, you’ll be taken to a page that shows a number of modern, social media sites (see the first screenshot). You can select one of the pre-set sites in the list, and you’ll be taken to share a post there. But if you, for example, have a Mastodon instance, or a Known site, or an IndieWeb site at a different domain, you can enter that domain in the box, and ShareOpenly will try and find a way to let you share the page with that site.
     23Activate this plugin and, at the bottom of every post and/or page on your site, you’ll see a "share to social media" button. If you click it, you’ll be taken to a page that shows a number of modern, social media sites (see the first screenshot). You can select one of the pre-set sites in the list, and you’ll be taken to share a post there. But if you, for example, have a Mastodon instance, or a Known site, or an IndieWeb site at a different domain, you can enter that domain in the box, and ShareOpenly will try and find a way to let you share the page with that site.
    2424
    25 * Tested up to PHP 8.2
    26 * Fully complies with WordPress coding standards
    27 * Compliant with the stronger [WordPress VIP](https://wpvip.com/) coding standards, as well as compatibility with their platform
    28 * Community plugin - visit the [Github page](https://github.com/dartiss/share-openly "Github") to get involved with the latest code development, request enhancements and report issues
     25* Tested up to PHP 8.4
     26* Follows WordPress coding standards
     27* Designed to be compatible with [WP VIP](https://wpvip.com/) coding standards, as well as compatibility with their platform
     28* Community plugin - visit the [GitHub page](https://github.com/dartiss/share-openly "GitHub") to get involved with the latest code development, request enhancements and report issues
     29
     30== Support & Contributing ==
     31
     32If you would like to contribute to the code, report issues, request features or help with translation, then please use one of the following methods to do so...
     33
     34* For support queries please [use the plugin forum on WordPress.org](https://wordpress.org/support/plugin/shareopenly/)
     35* To contribute to the code, suggest enhancements or report bugs you can [do so on my GitHub repo](https://github.com/dartiss/shareopenly)
     36* For translations, please [use GlotPress](https://translate.wordpress.org/projects/wp-plugins/shareopenly/)
     37
     38If you wish to disclose a security issue then I would ask that you do so responsibly. For example, you could [submit it via Wordfence](https://www.wordfence.com/threat-intel/vulnerabilities/submit/), which this plugin is registered with.
     39
     40== Privacy ==
     41
     42This plugin does not store personal data. Clicking a share link navigates the user to a third-party (or user-specified) site to complete the share.
     43
     44Since v1.2, the share icon is loaded locally; no external assets or scripts are loaded by the plugin.
    2945
    3046== Installation ==
     
    34501. Upload the entire unzipped plugin folder to your `wp-content/plugins/` directory, either from WP Admin (Plugins -> Add New), your favorite FTP client or any other file manager
    35512. Activate the plugin through the 'Plugins' menu in WP Admin (Plugins -> Installed Plugins)
     52
     53== Plugin Settings ==
     54
     55By default, nothing needs to be done for the new sharing options to appear. However, a number of settings are available, allowing for you to modify the results.
     56
     57In Settings -> Discussion -> ShareOpenly, you can configure:
     581.  Location – where sharing links appear (Posts, Pages, or both)
     592.  Share text – the text shown next to the icon
     603.  Priority – the filter priority used for output ordering (default: 10) 
     61
     62After changing any of the settings, make sure to press the "Save Changes" button at the bottom of the screen.
    3663
    3764== Screenshots ==
     
    4673ShareOpenly will do a few things first:
    4774
    48 1. If it’s on a “well-known” domain — eg, facebook.com — it’ll send you to the share page there.
     751. If it’s on a "well-known" domain — eg, facebook.com — it’ll send you to the share page there.
    49762. It checks to see if it can figure out if the site is on a known platform (currently Mastodon, Known, hosted WordPress, micro.blog, and a few others). If so — hooray! — it knows the share URL, and off you go.
    50 3. It looks for a `<link rel=“share-url”>` header tag on the page. The href attribute should be set to the share URL for the site, with template variables {text} and (optionally) {url} present where the share text and URL should go. (If {url} is not present, the URL to share will be appended at the end of the text.) If it’s there — yay! — we forward there, replacing {text} and {url} as appropriate.
     773. It looks for a `<link rel="share-url">` header tag on the page. The href attribute should be set to the share URL for the site, with template variables {text} and (optionally) {url} present where the share text and URL should go. (If {url} is not present, the URL to share will be appended at the end of the text.) If it’s there — yay! — we forward there, replacing {text} and {url} as appropriate.
    5178
    5279Once you’ve shared to a site, the next time you visit ShareOpenly, it will be in the quick links.
     
    6693No. It was developed for WordPress and so forks remain unsupported. I have no intention of developing and testing this on any other version.
    6794
     95= How do you uninstall the plugin and what does it do? =
     96
     97When you uninstall the plugin via the Plugins menu in WP Admin, all saved settings will be deleted along with the plugin files, leaving no residual data behind.
     98
     99= Is this plugin accessible? =
     100
     101By default, the link that is displayed has an accessible name (although this can be changed by the user), the icon is decorative and focus is visible. I would love to hear from you if you experience any problems, however (please see the previous section on how to contribute).
     102
    68103== Changelog ==
    69104
    70105I use semantic versioning, with the first release being 1.0
     106
     107= 1.2 =
     108* Enhancement: Added additional information to the README
     109* Enhancement: Improved accessibility, performance and security across the plugin
     110* Enhancement: Moved the SVG icon from an external link to locally
     111* Enhancement: Now making sure I'm defining the priority setting as a number and not a text field
     112* Enhancement: Updated the WordPress requirements script (v1.1 -> v1.2)
     113* Bug: Removed the smart quotes that were in the README. Thanks to [Terence Eden](https://shkspr.mobi/blog/) for identifying and reporting it
    71114
    72115= 1.1 =
     
    83126== Upgrade Notice ==
    84127
    85 = 1.1 =
    86 * Now with custom post types!
     128= 1.2 =
     129* Assorted code quality improvements. Now more secure, accessible and performant!
  • shareopenly/tags/1.2/shareopenly.php

    r3137746 r3348892  
    1010 * Plugin URI:        https://wordpress.org/plugins/shareopenly/
    1111 * Description:       The official plugin for ShareOpenly, adding modern, open social media sharing links to your website.
    12  * Version:           1.1
     12 * Version:           1.2
    1313 * Requires at least: 4.6
    1414 * Requires PHP:      8.0
Note: See TracChangeset for help on using the changeset viewer.