Skip to content

Commit

Permalink
Merge pull request #53 from harikrut/add-closed-notice
Browse files Browse the repository at this point in the history
Add noticed about closed plugin and install fork plugin to ongoing support.
  • Loading branch information
iamdharmesh committed Feb 11, 2024
2 parents 7103e48 + 1a6232a commit bcfe1e9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 7 deletions.
8 changes: 6 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Contributors: dharm1025,hazemkhaled,esl4m,firstanonymous
Tags: featured image, url, image url, image, woocommerce, remote featured image, product gallery
Requires PHP: 5.3
Requires at least: 5.8
Tested up to: 6.2
Tested up to: 6.4
WC tested up to: 4.0.1
Stable tag: 1.1.9
Stable tag: 1.1.10
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -63,6 +63,10 @@ Featured Image by URL allows to use an external URL Images as Featured Image for
6. Settings Panel

== Changelog ==
= 1.1.10 =
* Tested with WP 6.4
* Add notice about plugin closure and installation of the new plugin

= 1.1.9 =
* Tested with WP 6.2

Expand Down
6 changes: 3 additions & 3 deletions featured-image-by-url.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Featured Image by URL
* Plugin URI: https://wordpress.org/plugins/featured-image-by-url/
* Description: This plugin allows to use an external URL Images as Featured Image for your post types. Includes support for Product Gallery (WooCommece).
* Version: 1.1.9
* Version: 1.1.10
* Author: Knawat
* Author URI: https://www.knawat.com/?utm_source=wordpress.org&utm_medium=social&utm_campaign=WordPress%20Image%20by%20URL
* License: GPL-2.0+
Expand Down Expand Up @@ -77,14 +77,14 @@ private function __construct() { /* Do nothing here */ }
*
* @since 1.0.0
*/
public function __clone() { _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'featured-image-by-url' ), '1.1.9' ); }
public function __clone() { _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'featured-image-by-url' ), '1.1.10' ); }

/**
* A dummy magic method to prevent Featured_Image_By_URL from being unserialized.
*
* @since 1.0.0
*/
public function __wakeup() { _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'featured-image-by-url' ), '1.1.9' ); }
public function __wakeup() { _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'featured-image-by-url' ), '1.1.10' ); }


/**
Expand Down
36 changes: 34 additions & 2 deletions includes/class-featured-image-by-url-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public function __construct() {
// Add & Save Product Variation Featured image by URL.
add_action( 'woocommerce_product_after_variable_attributes', array( $this, 'knawatfibu_add_product_variation_image_selector' ), 10, 3 );
add_action( 'woocommerce_save_product_variation', array( $this, 'knawatfibu_save_product_variation_image' ), 10, 2 );

add_action( 'admin_notices', array( $this, 'add_admin_notices' ) );
}
}

Expand Down Expand Up @@ -112,7 +114,7 @@ function knawatfibu_render_wcgallary_metabox( $post ) {
function enqueue_admin_styles( $hook ) {

$css_dir = KNAWATFIBU_PLUGIN_URL . 'assets/css/';
wp_enqueue_style('knawatfibu-admin', $css_dir . 'featured-image-by-url-admin.css', array(), '1.1.9', "" );
wp_enqueue_style('knawatfibu-admin', $css_dir . 'featured-image-by-url-admin.css', array(), '1.1.10', "" );

}

Expand Down Expand Up @@ -317,6 +319,11 @@ function knawatfibu_options_page_html() {
* @return void
*/
function knawatfibu_settings_init() {
$is_active = is_plugin_active( 'featured-image-with-url/featured-image-with-url.php' );
if ( ! $is_active ) {
add_thickbox();
}

register_setting( 'knawatfibu', KNAWATFIBU_OPTIONS );

add_settings_section(
Expand Down Expand Up @@ -521,4 +528,29 @@ public function knawatfibu_sanitize( $var ) {
return is_scalar( $var ) ? sanitize_text_field( wp_unslash( $var ) ) : $var;
}
}
}

/**
* Add admin notices
*
* @return void
*/
public function add_admin_notices() {
$is_active = is_plugin_active( 'featured-image-with-url/featured-image-with-url.php' );
if ( $is_active || ! current_user_can( 'manage_options' ) ) {
return;
}
?>
<div class="notice notice-warning is-dismissible">
<p>
<?php
printf(
__( 'The <strong>Feature Image by URL</strong> plugin has been closed and is no longer being maintained. To ensure uninterrupted functionality, please install and activate the %1$sFeature Image with URL%2$s plugin. <strong>Feature Image with URL</strong> is a fork of the <strong>Feature Image by URL</strong> plugin, developed to provide ongoing support to existing users. All functionalities of the plugin will work seamlessly without any issues.', 'featured-image-by-url' ),
'<a href="' . esc_url( admin_url( 'plugin-install.php?tab=plugin-information&plugin=featured-image-with-url&TB_iframe=true&width=772&height=670' ) ) . '" class="thickbox open-plugin-details-modal"><strong>',
'</strong></a>'
);
?>
</p>
</div>
<?php
}
}

0 comments on commit bcfe1e9

Please sign in to comment.