HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //proc/self/cwd/wp-content/plugins/elementskit-lite/compatibility/data-migration/translate-file.php
<?php

namespace ElementsKit_Lite\Compatibility\Data_Migration;

defined('ABSPATH') || exit;

class Translate_File {

	use \ElementsKit_Lite\Traits\Singleton;

	private $OK_Translate_File = 'ekit_translate_file_checked';

	public static function load_filesystem() {

		require_once ABSPATH .'wp-admin/includes/file.php';

		WP_Filesystem();
	}

	public function init() {

		$option = get_option($this->OK_Translate_File, 'no');

		if($option == 'no') {

			self::load_filesystem();

			global $wp_filesystem;


			$the_dir = WP_LANG_DIR.'/plugins/';
			$files = $wp_filesystem->dirlist($the_dir);

			$o_dom = 'elementskit-';
			$n_dom = 'elementskit-lite-';


			$file_pattern = 'elementskit-';
			$ln = strlen($file_pattern);
			$invalid_pattern = '/elementskit\-.+\-.+/';

			if(!empty($files)) {
				foreach($files as $file) {

					$nm = $file['name'];

					$dbg['cont']['pahase0'][] = 9;

					/**
					 * Checking if file name is started with elementskit-
					 */
					if(substr($nm, 0, $ln) == $file_pattern) {

						/**
						 * Checking if file name is like this pattern elementskit-blabla-
						 * If so we will not process it
						 *
						 */
						if(preg_match($invalid_pattern, $nm)) {

							continue;
						}

						/**
						 * Preparing a new name for the file
						 * and copying it i the same directory
						 *
						 */
						$new_name = str_replace($o_dom, $n_dom, $nm);
						$wp_filesystem->copy($the_dir.$nm, $the_dir.$new_name, true);
					}
				}
			}


			/**
			 * As we have copied all the files
			 * we do not want to run this every time
			 * so we are updating the flag in wordpress option
			 */

			update_option($this->OK_Translate_File, 'yes');

		}

		return true;
	}
}