at path:
ROOT
/
wp-content
/
plugins
/
wplr-sync
/
classes
/
init.php
run:
R
W
Run
admin.php
43.65 KB
2025-12-03 14:11:38
R
W
Run
Delete
Rename
api.php
11.32 KB
2026-04-15 13:09:44
R
W
Run
Delete
Rename
core.php
79.15 KB
2026-04-15 13:09:44
R
W
Run
Delete
Rename
error.php
3.68 KB
2021-05-20 07:11:02
R
W
Run
Delete
Rename
explorer.php
2.92 KB
2026-01-27 09:01:44
R
W
Run
Delete
Rename
init.php
3.82 KB
2025-11-13 15:52:46
R
W
Run
Delete
Rename
keywords.php
3.36 KB
2026-04-25 14:46:28
R
W
Run
Delete
Rename
lrinfo.php
1.67 KB
2021-05-20 07:11:02
R
W
Run
Delete
Rename
public_api.php
4.91 KB
2024-10-17 12:37:14
R
W
Run
Delete
Rename
response.php
4.78 KB
2021-05-20 07:11:02
R
W
Run
Delete
Rename
rest.php
39.6 KB
2026-02-25 20:11:08
R
W
Run
Delete
Rename
troubleshoot.php
2.43 KB
2021-05-20 07:11:02
R
W
Run
Delete
Rename
ui.php
493 By
2021-05-20 07:11:02
R
W
Run
Delete
Rename
wplr-sync.log
20.83 KB
2023-09-08 12:37:56
R
W
Run
Delete
Rename
error_log
up
📄
init.php
Save
<?php function meow_wplrsync_activate() { global $wpdb; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); $charset_collate = $wpdb->get_charset_collate(); $tbl_lrsync = $wpdb->prefix . "lrsync"; $sql = "CREATE TABLE $tbl_lrsync ( id BIGINT(20) NOT NULL AUTO_INCREMENT, wp_id BIGINT(20) NULL, lr_id BIGINT(20) NULL, lr_file TINYTEXT NULL, lastsync DATETIME NULL, PRIMARY KEY id (id) ) " . $charset_collate . ";"; dbDelta($sql); $tbl_collections = $wpdb->prefix . "lrsync_collections"; $isNewToCollections = ($wpdb->get_var("SHOW TABLES LIKE '$tbl_collections'") != $tbl_collections); $sql = "CREATE TABLE $tbl_collections ( wp_col_id BIGINT(20) NOT NULL AUTO_INCREMENT, source TINYTEXT NULL, lr_col_id BIGINT(20) NULL, wp_folder_id BIGINT(20) NULL, name TINYTEXT NULL, slug TINYTEXT NULL, is_folder TINYINT(1) NOT NULL DEFAULT 0, featured_id BIGINT(20) NULL, lastsync DATETIME NULL, PRIMARY KEY id (wp_col_id) ) " . $charset_collate . ";"; dbDelta($sql); $tbl_relations = $wpdb->prefix . "lrsync_relations"; $sql = "CREATE TABLE $tbl_relations ( id BIGINT(20) NOT NULL AUTO_INCREMENT, wp_col_id BIGINT(20) NULL, wp_id BIGINT(20) NULL, sort INT(11) DEFAULT 0, PRIMARY KEY id (id), UNIQUE KEY id (wp_col_id, wp_id) ) " . $charset_collate . ";"; dbDelta($sql); $tbl_meta = $wpdb->prefix . "lrsync_meta"; $isNewToCollections = ($wpdb->get_var("SHOW TABLES LIKE '$tbl_meta'") != $tbl_meta); $sql = "CREATE TABLE $tbl_meta ( meta_id BIGINT(20) NOT NULL AUTO_INCREMENT, name TINYTEXT NULL, id BIGINT(20) NULL, value LONGTEXT NULL, PRIMARY KEY id (meta_id) ) " . $charset_collate . ";"; dbDelta($sql); // If this install is new to Collections, insert all the linked // media in the -1 collection (default one) if ($isNewToCollections) { $wpdb->query("INSERT INTO $tbl_relations (wp_col_id, wp_id, sort) SELECT -1, wp_id, 0 FROM $tbl_lrsync"); } // The source might be missing, it needs to be set and by default it's Lightroom. $wpdb->query($wpdb->prepare("UPDATE $tbl_collections SET source = '%s' WHERE source IS NULL OR source = ''", 'lr')); // This is more like cleaning and making sure wp_folder_id is null instead of 0 (that happened to someone somehow). $wpdb->query("UPDATE $tbl_collections SET wp_folder_id = NULL WHERE wp_folder_id = '0'"); } function meow_wplrsync_uninstall() { // Better to avoid removing the table... global $wpdb; $tbl_col = $wpdb->prefix . 'lrsync_collections'; $tbl_r = $wpdb->prefix . 'lrsync_relations'; $tbl_m = $wpdb->prefix . 'lrsync_meta'; $tbl_lr = $wpdb->prefix . 'lrsync'; $wpdb->query("DROP TABLE IF EXISTS $tbl_col"); $wpdb->query("DROP TABLE IF EXISTS $tbl_r"); $wpdb->query("DROP TABLE IF EXISTS $tbl_lr"); $wpdb->query("DROP TABLE IF EXISTS $tbl_m"); } spl_autoload_register(function ($class) { $necessary = true; $file = null; if (strpos($class, 'Meow_WPLR_Sync') !== false) { $file = WPLR_SYNC_PATH . '/classes/' . str_replace('meow_wplr_sync_', '', strtolower($class)) . '.php'; } else if (strpos($class, 'MeowKit_WPLR_') !== false) { $file = WPLR_SYNC_PATH . '/common/' . str_replace('meowkit_wplr_', '', strtolower($class)) . '.php'; } else if (strpos($class, 'MeowKitPro_WPLR_') !== false) { $file = WPLR_SYNC_PATH . '/common/premium/' . str_replace('meowkitpro_wplr_', '', strtolower($class)) . '.php'; } else if (strpos($class, 'MeowPro_WPLR_Sync') !== false) { $necessary = false; $file = WPLR_SYNC_PATH . '/premium/' . str_replace('meowpro_wplr_sync_', '', strtolower($class)) . '.php'; } if ($file) { if (!$necessary && !file_exists($file)) { return; } require($file); } }); //require_once( WPLR_SYNC_PATH . '/classes/api.php'); require_once(WPLR_SYNC_PATH . '/common/helpers.php'); global $wplr; $wplr = new Meow_WPLR_Sync_Core();