version_notice(); } } /** * Plugin version check * * @return bool */ public static function check_plugin_version() { if ( defined('RT_TPG_PRO_VERSION') && version_compare( RT_TPG_PRO_VERSION, self::$compare_version, '<' ) ) { return false; } return true; } /** * Notice * * @return void */ public function version_notice() { if ( class_exists( 'RtTpgPro' ) || class_exists( 'rtTPGP' ) ) { add_action( 'admin_notices', function () { $class = 'notice notice-error'; $text = esc_html__( 'The Post Grid Pro', 'the-post-grid' ); $link_pro = '//www.radiustheme.com/downloads/the-post-grid-pro-for-wordpress/'; printf( '

The Post Grid Pro is not working properly, You need to update %3$s version to %4$s or more to get the pro features.

', esc_attr( $class ), esc_url( $link_pro ), esc_html( $text ), self::$compare_version ); } ); } } /** * Notification * * @param array $links Link. * @param string $file File. * * @return array */ public function show_update_notification( $links, $file ) { if ( $file == 'the-post-grid-pro/the-post-grid-pro.php' ) { $row_meta['tpg_update'] = 'The Plugin is not compatible with the post grid free. Please update the plugin to ' . self::$compare_version . ' or more otherwise it will not activate.'; return array_merge( $links, $row_meta ); } return (array) $links; } }