Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Admin_Tools::sysinfo_text()

Get system info


Description Description


Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808

Return Return

(string) $return A string containing the info to output


Top ↑

Source Source

File: classes/Admin/Tools.php

							<?php $checked = self::extension_has_beta_support( $slug ); ?>
							<th scope="row"><?php echo esc_html( $product ); ?></th>
							<td>
								<input type="checkbox" name="enabled_betas[<?php echo esc_attr( $slug ); ?>]" id="enabled_betas[<?php echo esc_attr( $slug ); ?>]"<?php echo checked( $checked, true, false ); ?> value="1" />
								<label for="enabled_betas[<?php echo esc_attr( $slug ); ?>]"><?php printf( __( 'Get updates for pre-release versions of %s', 'popup-maker' ), $product ); ?></label>
							</td>
						</tr>
					<?php endforeach; ?>
					</tbody>
				</table>
				<input type="hidden" name="pum_action" value="save_enabled_betas" />
				<?php wp_nonce_field( 'pum_save_betas_nonce', 'pum_save_betas_nonce' ); ?>
				<?php submit_button( __( 'Save', 'popup-maker' ), 'secondary', 'submit', false ); ?>
			</div>
		</div>

		<?php
		do_action( 'pum_tools_betas_after' );
	}

	/**
	 * Displays the contents of the Error Log tab
	 *
	 * @since 1.12.0
	 */
	public static function errorlog_display() {
		?>
		<h2>Error Log</h2>
		<a target="_blank" rel="noreferrer noopener" href="<?php echo esc_url( PUM_Utils_Logging::instance()->get_file_url() ); ?>" download="pum-debug.log" class="button button-primary button-with-icon"><i class="dashicons dashicons-download"></i>Download Error Log</a>
		<form action="" method="POST">
			<input type="hidden" name="pum_action" value="empty_error_log" />
			<?php wp_nonce_field( 'pum_popup_empty_log_nonce', 'pum_popup_empty_log_nonce' ); ?>
			<?php submit_button( 'Empty Error Log', '', 'popmake-empty-log', false ); ?>
		</form>
		<div id="log-viewer">
			<pre><?php echo esc_html( self::display_error_log() ); ?></pre>
		</div>
		<?php
	}

	/**
	 * Displays the content for the Scheduled Actions tab.
	 *
	 * @uses ActionScheduler_AdminView::render_admin_ui()
	 * @since 1.12.0
	 */
	public static function action_scheduler_display() {
		if ( class_exists( 'ActionScheduler_AdminView' ) ) {
			$test = new ActionScheduler_AdminView();
			$test->render_admin_ui();
		}
	}

	/**
	 * Displays the contents for the Import tab
	 *
	 * @since 1.12.0
	 */
	public static function import_display() {
		?>
		<h2>Using Easy Modal?</h2>
		<p>Click this button to import popups from the Easy Modal plugin.</p>
		<button id="popmake_emodal_v2_import" name="popmake_emodal_v2_import" class="button button-large">
			<?php esc_html_e( 'Import From Easy Modal v2', 'popup-maker' ); ?>
		</button>
		<?php
	}

	/**
	 * Add a button to import easy modal data.
	 *
	 * @deprecated
	 */
	public static function emodal_v2_import_button() {
		self::import_display();
	}

	/**
	 * Empties error log when user clicks on button
	 *
	 * @since 1.12.0
	 */
	public static function error_log_empty() {
		if ( ! is_user_logged_in() || ! current_user_can( 'manage_options' ) || ! wp_verify_nonce( $_POST['pum_popup_empty_log_nonce'], 'pum_popup_empty_log_nonce' ) ) {
			return;
		}
		PUM_Utils_Logging::instance()->clear_log();
	}

	/**
	 * Process em import.
	 */
	public static function emodal_process_import() {
		if ( ! isset( $_REQUEST['popmake_emodal_v2_import'] ) ) {
			return;
		}
		popmake_emodal_v2_import();
		wp_redirect( admin_url( 'edit.php?post_type=popup&page=pum-tools&imported=1' ), 302 );
	}

	/**
	 * Save enabled betas
	 *
	 * @since       1.5
	 */
	public static function save_enabled_betas() {
		if ( ! wp_verify_nonce( $_POST['pum_save_betas_nonce'], 'pum_save_betas_nonce' ) ) {
			return;
		}

		if ( ! current_user_can( 'manage_options' ) ) {
			return;
		}

		if ( ! empty( $_POST['enabled_betas'] ) ) {
			$enabled_betas = array_filter(
				array_map(
					array(
						__CLASS__,
						'enabled_betas_sanitize_value',
					),
					$_POST['enabled_betas']
				)
			);
			PUM_Utils_Options::update( 'enabled_betas', $enabled_betas );
		} else {
			PUM_Utils_Options::delete( 'enabled_betas' );
		}
	}

	/**
	 * Sanitize the supported beta values by making them booleans
	 *
	 * @param mixed $value The value being sent in, determining if beta support is enabled.
	 *
	 * @return bool
	 * @since 1.5
	 */
	public static function enabled_betas_sanitize_value( $value ) {
		return filter_var( $value, FILTER_VALIDATE_BOOLEAN );
	}

	/**
	 * Check if a given extensions has beta support enabled
	 *
	 * @param string $slug The slug of the extension to check.
	 *
	 * @return      bool True if enabled, false otherwise
	 * @since       1.5
	 */
	public static function extension_has_beta_support( $slug ) {
		$enabled_betas = PUM_Utils_Options::get( 'enabled_betas', array() );
		$return        = false;

		if ( array_key_exists( $slug, $enabled_betas ) ) {
			$return = true;
		}

		return $return;
	}

	/**
	 * Retrieves error log and prepares it for displaying
	 *
	 * @uses PUM_Utils_Logging::get_log()
	 * @since 1.12.0
	 */
	public static function display_error_log() {
		return PUM_Utils_Logging::instance()->get_log();
	}
}

Top ↑

Changelog Changelog

Changelog
Version Description
1.5 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.