Uname:Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64

403WebShell
403Webshell
Server IP : 146.59.209.152  /  Your IP : 216.73.216.152
Web Server : Apache
System : Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : monpetu ( 144298)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/monpetu/www/ipprint/wp-content/plugins/surerank/inc/functions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/monpetu/www/ipprint/wp-content/plugins/surerank/inc/functions/update.php
<?php
/**
 * Update
 *
 * @package surerank
 * @since 0.0.1
 */

namespace SureRank\Inc\Functions;

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

use WP_Error;

/**
 * Update
 *
 * @since 1.0.0
 */
class Update {

	/**
	 * Update post meta
	 * This function will update post meta
	 *
	 * @param int                                                $post_id    Post ID.
	 * @param string                                             $meta_key   Meta key.
	 * @param array<string, mixed>|array<int, string>|string|int $meta_value Meta value.
	 *
	 * @since 1.0.0
	 * @return bool|int
	 */
	public static function post_meta( $post_id, $meta_key, $meta_value ) {
		return update_post_meta( $post_id, $meta_key, $meta_value );
	}

	/**
	 * Update term meta
	 * This function will update post meta
	 *
	 * @param int   $term_id    Post ID.
	 * @param mixed $meta_key   Meta key.
	 * @param mixed $meta_value Meta value.
	 *
	 * @since 1.0.0
	 * @return bool|int|WP_Error
	 */
	public static function term_meta( $term_id, $meta_key, $meta_value ) {
		return update_term_meta( $term_id, $meta_key, $meta_value );
	}

	/**
	 * Update user meta
	 * This function will update user meta
	 *
	 * @param int   $user_id    User ID.
	 * @param mixed $meta_key   Meta key.
	 * @param mixed $meta_value Meta value.
	 *
	 * @since 1.9.0
	 * @return bool|int
	 */
	public static function user_meta( $user_id, $meta_key, $meta_value ) {
		return update_user_meta( $user_id, $meta_key, $meta_value );
	}

	/**
	 * Update the option.
	 *
	 * @param string $option_name Option name.
	 * @param mixed  $option_value Option value.
	 * @param bool   $autoload     Whether to autoload the option.
	 * @since 1.0.0
	 * @return bool
	 */
	public static function option( $option_name, $option_value, $autoload = false ) {
		// Main settings should always be autoloaded — read on every page.
		if ( defined( 'SURERANK_SETTINGS' ) && SURERANK_SETTINGS === $option_name ) {
			$autoload = true;
		}

		$result = update_option( $option_name, $option_value, $autoload );

		// Clear settings cache when the main settings option is updated.
		if ( defined( 'SURERANK_SETTINGS' ) && SURERANK_SETTINGS === $option_name ) {
			Settings::clear_cache();
		}

		return $result;
	}

	/**
	 * Update SEO Checks WP Posts.
	 *
	 * @param int                  $post_id Post ID.
	 * @param array<string, mixed> $seo_checks SEO Checks.
	 * @since 1.0.0
	 * @return bool
	 */
	public static function post_seo_checks( $post_id, $seo_checks ) {
		$existing_seo_checks = get_post_meta( $post_id, SURERANK_SEO_CHECKS, true );
		$existing_seo_checks = is_array( $existing_seo_checks ) ? $existing_seo_checks : [];

		$final_seo_checks = array_filter( array_merge( $existing_seo_checks, $seo_checks ) );

		self::post_meta( $post_id, SURERANK_SEO_CHECKS, $final_seo_checks );
		self::post_meta( $post_id, SURERANK_SEO_CHECKS_LAST_UPDATED, time() );

		return true;
	}

	/**
	 * Update SEO Checks for taxonomies.
	 *
	 * @param int                  $term_id Term ID.
	 * @param array<string, mixed> $seo_checks SEO Checks.
	 * @since 1.0.0
	 * @return bool
	 */
	public static function taxonomy_seo_checks( $term_id, $seo_checks ) {
		$existing_seo_checks = get_term_meta( $term_id, SURERANK_SEO_CHECKS, true );
		$existing_seo_checks = is_array( $existing_seo_checks ) ? $existing_seo_checks : [];

		$final_seo_checks = array_filter( array_merge( $existing_seo_checks, $seo_checks ) );

		self::term_meta( $term_id, SURERANK_SEO_CHECKS, $final_seo_checks );
		self::term_meta( $term_id, SURERANK_SEO_CHECKS_LAST_UPDATED, time() );
		return true;
	}

	/**
	 * Update SEO Checks for users.
	 *
	 * @param int                  $user_id User ID.
	 * @param array<string, mixed> $seo_checks SEO Checks.
	 * @since 1.9.0
	 * @return bool
	 */
	public static function user_seo_checks( $user_id, $seo_checks ) {
		$existing_seo_checks = get_user_meta( $user_id, SURERANK_SEO_CHECKS, true );
		$existing_seo_checks = is_array( $existing_seo_checks ) ? $existing_seo_checks : [];

		$final_seo_checks = array_filter( array_merge( $existing_seo_checks, $seo_checks ) );

		self::user_meta( $user_id, SURERANK_SEO_CHECKS, $final_seo_checks );
		self::user_meta( $user_id, SURERANK_SEO_CHECKS_LAST_UPDATED, time() );
		return true;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit