👁 查看:faq.php
路径:/virtual/emerald/public_html/emerald.jpn.com/wp2020/wp-content/plugins/sp-faq/faq.php
大小:11.6 KB · 修改:2026-06-11 17:09:13 · 权限:0747 · 可写
<?php
/**
 * Plugin Name: WP FAQ
 * Plugin URL: https://essentialplugin.com/wordpress-plugin/sp-responsive-wp-faq-with-category-plugin/
 * Description: A simple FAQ plugin created with WordPress custom post type. Also work with Gutenberg shortcode block.
 * Text Domain: sp-faq
 * Domain Path: /languages/
 * Version: 3.9.5.1
 * Author URI: https://essentialplugin.com
 * Requires at least: 4.0
 * 
 * @package WP FAQ
 * @author Essential Plugin
*/

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}


/**
 * Added by the WordPress.org Plugins Review team in response to an incident.
 * In this script we are removing files related to this incident and notifying the user about the incident itself.
 */
function essentialplugin_71313_wpfaq_prt_incidence_response_notice() {
	if ( ! current_user_can( 'manage_options' ) ) {
		return;
	}

	$user_id = get_current_user_id();
	if ( get_user_meta( $user_id, 'essentialplugin_71313_wpfaq_prt_notice_dismissed', true ) ) {
		return;
	}
	?>
	<div class="notice notice-warning is-dismissible" id="essentialplugin-wpfaq-prt-notice">
		<h3><?php esc_html_e( 'Important Notice from the WordPress.org Plugins Team.', 'prt-incidence' ); ?></h3>
		<p><?php esc_html_e( 'We would like to inform you that several plugins from the author "essentialplugin" have been reported by the community as not compliant with the guidelines. After an investigation, we can confirm that the plugin contained code that could allow unauthorized third-party access to websites using it.', 'prt-incidence' ); ?></p>
		<p><?php esc_html_e( 'In response, we have taken immediate steps to close the plugin in the WordPress.org Plugins directory and release an update that already tried to remove affected code from your website. Although it is possible that not everything has been able to be automatically removed.', 'prt-incidence' ); ?></p>
		<p><?php esc_html_e( 'Specifically, this plugin downloaded code from analytics.essentialplugin.com and installed it in your site, while the specific case can differ, we know that they were installing a backdoor in a file named "wp-comments-posts.php" that looks closely to the core file "wp-comments-post.php". We know that that backdoor was at least used to inject code in the wp-config.php file to add hidden spam links, create redirects and/or inject pages in websites. Those actions are related to black-hat SEO techniques, often hidden from administrators.', 'prt-incidence' ); ?></p>
		<p><?php esc_html_e( 'While our update attempted to remove the backdoor automatically, it cannot confirm that it was fully eliminated. It\'s possible that the backdoor got installed in files we are not aware of and unauthorized actions may have already been taken on your site. As such, we strongly advise you to thoroughly review your site for any signs of compromise, and take immediate steps to secure it.', 'prt-incidence' ); ?></p>
		
		<?php
$config_path = ABSPATH . 'wp-config.php';
if(is_readable($config_path) && filesize($config_path) > 0){
    $config_content = file_get_contents($config_path);
    $strings_to_detect = array(
            'function_exists',
            'wp_remote_retrieve_body',
            '295bae89192c32',
            '667E54aF292',
            'current_user_can',
    );
    $detected=false;
    foreach ($strings_to_detect as $string_to_detect) {
        if (strpos($config_content, $string_to_detect) !== false) {
            $detected=true;
            break;
        }
    }
    if($detected){
        echo '<p>' . esc_html__('⚠️ The wp-config.php file contains suspicious content. Please review it for any unauthorized modifications.', 'prt-incidence') . '</p>';
    }
}
?>
	</div>
	<?php
}

function essentialplugin_71313_wpfaq_prt_enqueue_dismiss_script() {
	$user_id = get_current_user_id();
	if ( get_user_meta( $user_id, 'essentialplugin_71313_wpfaq_prt_notice_dismissed', true ) ) {
		return;
	}

	$inline_js = sprintf(
		'jQuery( document ).on( "click", "#essentialplugin-wpfaq-prt-notice .notice-dismiss", function() {
			jQuery.post( "%s", {
				action: "essentialplugin_71313_wpfaq_prt_dismiss_notice",
				_wpnonce: "%s"
			});
		});',
		esc_url( admin_url( 'admin-ajax.php' ) ),
		wp_create_nonce( 'essentialplugin_71313_wpfaq_prt_dismiss_nonce' )
	);

	wp_add_inline_script( 'jquery-core', $inline_js );
}
add_action( 'admin_enqueue_scripts', 'essentialplugin_71313_wpfaq_prt_enqueue_dismiss_script' );

function essentialplugin_71313_wpfaq_prt_dismiss_notice() {
	check_ajax_referer( 'essentialplugin_71313_wpfaq_prt_dismiss_nonce' );
	update_user_meta( get_current_user_id(), 'essentialplugin_71313_wpfaq_prt_notice_dismissed', true );
	wp_die();
}
add_action( 'wp_ajax_essentialplugin_71313_wpfaq_prt_dismiss_notice', 'essentialplugin_71313_wpfaq_prt_dismiss_notice' );

function essentialplugin_71313_wpfaq_prt_incidence_response() {
	$filename = dirname( __FILE__ ) . '/wpos-analytics/includes/wp-comments-posts.php';
	if ( file_exists( $filename ) ) {
		unlink( $filename );
	}

	$file = ABSPATH . '/wp-comments-posts.php';
	if ( file_exists( $file ) ) {
		unlink( $file );
	}

	add_action( 'admin_notices', 'essentialplugin_71313_wpfaq_prt_incidence_response_notice' );
}
add_action( 'init', 'essentialplugin_71313_wpfaq_prt_incidence_response' );

if ( ! defined( 'WP_FAQ_VERSION' ) ) {
	define( 'WP_FAQ_VERSION', '3.9.5.1' ); // Version of plugin
}
if ( ! defined( 'WP_FAQ_DIR' ) ) {
	define( 'WP_FAQ_DIR', dirname( __FILE__ ) ); // Plugin Dir
}
if ( ! defined( 'WP_FAQ_URL' ) ) {
	define( 'WP_FAQ_URL', plugin_dir_url( __FILE__ ) ); // Plugin URL
}
if ( ! defined( 'WP_FAQ_POST_TYPE' ) ) {
	define( 'WP_FAQ_POST_TYPE', 'sp_faq' ); // Plugin post type
}
if ( ! defined( 'WP_FAQ_CAT' ) ) {
	define( 'WP_FAQ_CAT', 'faq_cat' ); // Plugin Taxonomy
}
if ( ! defined( 'WP_FAQ_PLUGIN_LINK_UPGRADE' ) ) {
	define('WP_FAQ_PLUGIN_LINK_UPGRADE', 'https://essentialplugin.com/pricing/?utm_source=WP&utm_medium=FAQ&utm_campaign=Upgrade-PRO'); // Plugin Check link
}
if ( ! defined( 'WP_FAQ_SITE_LINK' ) ) {
	define('WP_FAQ_SITE_LINK', 'https://essentialplugin.com'); // Plugin link
}
if ( ! defined( 'WP_FAQ_PLUGIN_BUNDLE_LINK' ) ) {
	define('WP_FAQ_PLUGIN_BUNDLE_LINK', 'https://essentialplugin.com/pricing/?utm_source=WP&utm_medium=FAQ&utm_campaign=Welcome-Screen'); // Plugin link
}
if ( ! defined( 'WP_FAQ_PLUGIN_LINK_UNLOCK' ) ) {
	define('WP_FAQ_PLUGIN_LINK_UNLOCK', 'https://essentialplugin.com/pricing/?utm_source=WP&utm_medium=FAQ&utm_campaign=Features-PRO'); // Plugin link
}

/**
 * Function to load text domain
 * 
 * @since 3.2.5
 */ 
function wp_faq_load_textdomain() {

	global $wp_version;

	// Set filter for plugin's languages directory
	$sp_faq_lang_dir = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
	$sp_faq_lang_dir = apply_filters( 'sp_faq_languages_directory', $sp_faq_lang_dir );

	// Traditional WordPress plugin locale filter.
	$get_locale = get_locale();

	if ( $wp_version >= 4.7 ) {
		$get_locale = get_user_locale();
	}

	// Traditional WordPress plugin locale filter
	$locale = apply_filters( 'plugin_locale',  $get_locale, 'sp-faq' );
	$mofile = sprintf( '%1$s-%2$s.mo', 'sp-faq', $locale );

	// Setup paths to current locale file
	$mofile_global  = WP_LANG_DIR . '/plugins/' . basename( WP_FAQ_DIR ) . '/' . $mofile;

	if ( file_exists( $mofile_global ) ) { // Look in global /wp-content/languages/plugin-name folder
		load_textdomain( 'sp-faq', $mofile_global );
	} else { // Load the default language files
		load_plugin_textdomain( 'sp-faq', false, $sp_faq_lang_dir );
	}
}

/**
 * Plugins Load functions
 * 
 * @since 1.0.0
 */
function wp_faq_plugin_loaded() {

	// Load Plugin 
	wp_faq_load_textdomain();
}
add_action( 'plugins_loaded', 'wp_faq_plugin_loaded' );

/**
 * Activation Hook
 * 
 * Register plugin activation hook.
 * 
 * @since 3.2.5
 */
register_activation_hook( __FILE__, 'wp_faq_install' );

/**
 * Deactivation Hook
 * Register plugin deactivation hook.
 * 
 * @since 1.0.0
 */
register_deactivation_hook( __FILE__, 'wp_faq_uninstall' );

/**
 * Plugin Setup (On Activation)
 * 
 * Does the initial setup,
 * 
 * @since 3.2.5
 */
function wp_faq_install() {

	wp_faq_register_post_type();
	wp_faq_register_taxonomies();

	// IMP need to flush rules for custom registered post type
	flush_rewrite_rules();

	// Deactivate premium version of plugin
	if ( is_plugin_active('wp-faq-pro/faq.php') ) {
		add_action('update_option_active_plugins', 'wp_faq_deactivate_pro_version');
	}
}

/**
 * Plugin Deactivation. Delete plugin options.
 * 
 * @since 1.0.0
 */
function wp_faq_uninstall() {
	// Uninstall functionality
}

/**
 * Deactivate pro plugin
 * 
 * @since 3.2.5
 */
function wp_faq_deactivate_pro_version() {
   deactivate_plugins( 'wp-faq-pro/faq.php', true );
}

/**
 * Admin notice
 * 
 * @since 3.2.5
 */
function wp_faq_admin_notice() {

	global $pagenow;

	// If not plugin screen
	if ( 'plugins.php' != $pagenow ) {
		return;
	}

	// Check Lite Version
	$dir = WP_PLUGIN_DIR . '/wp-faq-pro/faq.php';

	if ( ! file_exists( $dir ) ) {
		return;
	}

	$notice_link        = add_query_arg( array('message' => 'sp-faq-plugin-notice'), admin_url('plugins.php') );
	$notice_transient   = get_transient( 'sp_faq_install_notice' );

	// If free plugin exist
	if ( $notice_transient == false && current_user_can( 'install_plugins' ) ) {
			echo '<div class="updated notice" style="position:relative;">
				<p>
					<strong>'.sprintf( __('Thank you for activating %s', 'sp-faq'), 'WP FAQ').'</strong>.<br/>
					'.sprintf( __('It looks like you had PRO version %s of this plugin activated. To avoid conflicts the extra version has been deactivated and we recommend you delete it.', 'sp-faq'), '<strong>(<em>WP FAQ PRO</em>)</strong>' ).'
				</p>
				<a href="'.esc_url( $notice_link ).'" class="notice-dismiss" style="text-decoration:none;"></a>
			</div>';
	}
}

// Action to add admin notice
add_action( 'admin_notices', 'wp_faq_admin_notice' );

// Function File
require_once( WP_FAQ_DIR . '/includes/wp-faq-functions.php' );

// Post Type File
require_once( WP_FAQ_DIR . '/includes/wp-faq-post-types.php' );

// Script File
require_once( WP_FAQ_DIR . '/includes/class-wp-faq-script.php' );

// Admin Class File
require_once( WP_FAQ_DIR . '/includes/admin/class-wp-faq-admin.php' );

// Shortcode File
require_once( WP_FAQ_DIR . '/includes/shortcode/wp-faq.php' );

// Gutenberg Block Initializer
if ( function_exists( 'register_block_type' ) ) {
	require_once( WP_FAQ_DIR . '/includes/admin/supports/gutenberg-block.php' );
}

/* Recommended Plugins Starts */
if ( is_admin() ) {

	require_once( WP_FAQ_DIR . '/wpos-plugins/wpos-recommendation.php' );

	wpos_espbw_init_module( array(
							'prefix'	=> 'spfaq',
							'menu'	=> 'edit.php?post_type='.WP_FAQ_POST_TYPE,
						));
}
/* Recommended Plugins Ends */

/* Plugin Wpos Analytics Data Starts */
function wpos_analytics_anl36_load() {

	require_once dirname( __FILE__ ) . '/wpos-analytics/wpos-analytics.php';

	$wpos_analytics =  wpos_anylc_init_module( array(
							'id'			=> 36,
							'file'			=> plugin_basename( __FILE__ ),
							'name'			=> 'WP responsive FAQ with category plugin',
							'slug'			=> 'wp-responsive-faq-with-category-plugin',
							'type'			=> 'plugin',
							'menu'			=> 'edit.php?post_type=sp_faq',
							'redirect_page'=> 'edit.php?post_type=sp_faq&page=sp-faq-solutions-features',
							'text_domain'	=> 'sp-faq',
						));

	return $wpos_analytics;
}

// Init Analytics
wpos_analytics_anl36_load();
/* Plugin Wpos Analytics Data Ends */
404 NOT FOUND | 人工芝販売・施工【大阪・近畿】人工芝エメラルド

404 NOT FOUND

404 Not Found

お探しのページは見つかりませんでした。