diff --git a/.github/workflows/test-php.yml b/.github/workflows/test-php.yml index b783ba263..341f2ec19 100644 --- a/.github/workflows/test-php.yml +++ b/.github/workflows/test-php.yml @@ -24,7 +24,7 @@ jobs: run: composer install --prefer-dist --no-progress --quiet continue-on-error: true - name: Run PHPCS - run: composer run lint + run: composer run lint:errors continue-on-error: false php-unit: diff --git a/class-rop-autoloader.php b/class-rop-autoloader.php index a459495aa..36310ab2c 100644 --- a/class-rop-autoloader.php +++ b/class-rop-autoloader.php @@ -119,7 +119,7 @@ public static function loader( $class_name ) { $filename = 'class-' . str_replace( '_', '-', strtolower( $class_name ) ) . static::$file_ext; foreach ( static::$file_iterator as $file ) { if ( strtolower( $file->getFileName() ) === strtolower( $filename ) && is_readable( $file->getPathName() ) ) { - require( $file->getPathName() ); + require $file->getPathName(); return true; } } diff --git a/composer.json b/composer.json index 436e97d8f..2119f48f5 100644 --- a/composer.json +++ b/composer.json @@ -23,6 +23,7 @@ "build": "sh bin/dist.sh", "test": "vendor/bin/phpunit", "lint": "vendor/bin/phpcs --standard=phpcs.xml --extensions=php -s", + "lint:errors": "phpcs --standard=phpcs.xml -n", "format": "vendor/bin/phpcbf --standard=phpcs.xml --report-summary --report-source", "phpstan": "phpstan", "phpstan:generate:baseline": "phpstan --generate-baseline" @@ -52,11 +53,11 @@ "installer-disable": true }, "require-dev": { - "wp-coding-standards/wpcs": "^2.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "wp-coding-standards/wpcs": "^3.2", + "dealerdirect/phpcodesniffer-composer-installer": "^1.1.2", "phpunit/phpunit": "9.*", "yoast/phpunit-polyfills": "^2.0", - "codeinwp/phpcs-ruleset": "dev-main", + "automattic/vipwpcs": "^3.0", "phpstan/phpstan": "^2.1", "szepeviktor/phpstan-wordpress": "^2.0" }, diff --git a/composer.lock b/composer.lock index ff0ea431b..f5a139f32 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "414f9a7c89b5140711e2c342d07ecbec", + "content-hash": "9167977876d70ba10bc21d94f6e49056", "packages": [ { "name": "codeinwp/themeisle-sdk", @@ -106,32 +106,32 @@ "source": "https://github.com/abraham/twitteroauth", "issues": "https://github.com/abraham/twitteroauth/issues" }, - "time": "2025-07-14T13:47:00+00:00" + "time": "2025-07-14T12:47:15+00:00" }, { "name": "composer/ca-bundle", - "version": "1.3.7", + "version": "1.5.8", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "76e46335014860eec1aa5a724799a00a2e47cc85" + "reference": "719026bb30813accb68271fee7e39552a58e9f65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/76e46335014860eec1aa5a724799a00a2e47cc85", - "reference": "76e46335014860eec1aa5a724799a00a2e47cc85", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/719026bb30813accb68271fee7e39552a58e9f65", + "reference": "719026bb30813accb68271fee7e39552a58e9f65", "shasum": "" }, "require": { "ext-openssl": "*", "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "psr/log": "^1.0", - "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^8 || ^9", + "psr/log": "^1.0 || ^2.0 || ^3.0", + "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", "extra": { @@ -166,7 +166,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.7" + "source": "https://github.com/composer/ca-bundle/tree/1.5.8" }, "funding": [ { @@ -176,13 +176,9 @@ { "url": "https://github.com/composer", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2023-08-30T09:31:38+00:00" + "time": "2025-08-20T18:49:47+00:00" }, { "name": "facebook/graph-sdk", @@ -294,31 +290,32 @@ "packages-dev": [ { "name": "automattic/vipwpcs", - "version": "2.3.4", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/Automattic/VIP-Coding-Standards.git", - "reference": "b8610e3837f49c5f2fcc4b663b6c0a7c9b3509b6" + "reference": "2b1d206d81b74ed999023cffd924f862ff2753c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/b8610e3837f49c5f2fcc4b663b6c0a7c9b3509b6", - "reference": "b8610e3837f49c5f2fcc4b663b6c0a7c9b3509b6", + "url": "https://api.github.com/repos/Automattic/VIP-Coding-Standards/zipball/2b1d206d81b74ed999023cffd924f862ff2753c8", + "reference": "2b1d206d81b74ed999023cffd924f862ff2753c8", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", "php": ">=5.4", - "sirbrillig/phpcs-variable-analysis": "^2.11.17", - "squizlabs/php_codesniffer": "^3.7.1", - "wp-coding-standards/wpcs": "^2.3" + "phpcsstandards/phpcsextra": "^1.2.1", + "phpcsstandards/phpcsutils": "^1.0.11", + "sirbrillig/phpcs-variable-analysis": "^2.11.18", + "squizlabs/php_codesniffer": "^3.9.2", + "wp-coding-standards/wpcs": "^3.1.0" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9", "phpcsstandards/phpcsdevtools": "^1.0", - "phpunit/phpunit": "^4 || ^5 || ^6 || ^7" + "phpunit/phpunit": "^4 || ^5 || ^6 || ^7 || ^8 || ^9" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -343,74 +340,42 @@ "source": "https://github.com/Automattic/VIP-Coding-Standards", "wiki": "https://github.com/Automattic/VIP-Coding-Standards/wiki" }, - "time": "2023-08-24T15:11:13+00:00" - }, - { - "name": "codeinwp/phpcs-ruleset", - "version": "dev-main", - "source": { - "type": "git", - "url": "https://github.com/Codeinwp/phpcs-ruleset.git", - "reference": "982f9881312252e6213cde07704b74da47b39475" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeinwp/phpcs-ruleset/zipball/982f9881312252e6213cde07704b74da47b39475", - "reference": "982f9881312252e6213cde07704b74da47b39475", - "shasum": "" - }, - "require": { - "automattic/vipwpcs": "^2.0", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "sirbrillig/phpcs-variable-analysis": "^2.10", - "wptrt/wpthemereview": "*" - }, - "default-branch": true, - "bin": [ - "bin/phpcbf-fix-exit-0" - ], - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-or-later" - ], - "description": "PHPCS coding standards for Themeisle products.", - "support": { - "source": "https://github.com/Codeinwp/phpcs-ruleset/tree/main" - }, - "time": "2021-05-05T16:55:27+00:00" + "time": "2024-05-10T20:31:09+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.2", + "version": "v1.1.2", "source": { "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" + "url": "https://github.com/PHPCSStandards/composer-installer.git", + "reference": "e9cf5e4bbf7eeaf9ef5db34938942602838fc2b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/e9cf5e4bbf7eeaf9ef5db34938942602838fc2b1", + "reference": "e9cf5e4bbf7eeaf9ef5db34938942602838fc2b1", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", + "composer-plugin-api": "^2.2", + "php": ">=5.4", "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { - "composer/composer": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0" + "composer/composer": "^2.2", + "ext-json": "*", + "ext-zip": "*", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcompatibility/php-compatibility": "^9.0", + "yoast/phpunit-polyfills": "^1.0" }, "type": "composer-plugin", "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" }, "autoload": { "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -420,17 +385,16 @@ "authors": [ { "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" + "email": "opensource@frenck.dev", + "homepage": "https://frenck.dev", + "role": "Open source developer" }, { "name": "Contributors", - "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", @@ -450,10 +414,29 @@ "tests" ], "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "security": "https://github.com/PHPCSStandards/composer-installer/security/policy", + "source": "https://github.com/PHPCSStandards/composer-installer" }, - "time": "2022-02-04T12:51:07+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2025-07-17T20:45:56+00:00" }, { "name": "doctrine/instantiator", @@ -527,16 +510,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.13.4", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", "shasum": "" }, "require": { @@ -544,11 +527,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -574,7 +558,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" }, "funding": [ { @@ -582,7 +566,7 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2025-08-01T08:46:24+00:00" }, { "name": "nikic/php-parser", @@ -812,44 +796,43 @@ "time": "2025-07-16T06:41:00+00:00" }, { - "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", + "name": "phpcsstandards/phpcsextra", + "version": "1.4.0", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + "url": "https://github.com/PHPCSStandards/PHPCSExtra.git", + "reference": "fa4b8d051e278072928e32d817456a7fdb57b6ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/fa4b8d051e278072928e32d817456a7fdb57b6ca", + "reference": "fa4b8d051e278072928e32d817456a7fdb57b6ca", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" + "php": ">=5.4", + "phpcsstandards/phpcsutils": "^1.1.0", + "squizlabs/php_codesniffer": "^3.13.0 || ^4.0" }, "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.1.6", + "phpcsstandards/phpcsdevtools": "^1.2.1", + "phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ - { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" - }, { "name": "Juliette Reinders Folmer", "homepage": "https://github.com/jrfnl", @@ -857,81 +840,26 @@ }, { "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + "homepage": "https://github.com/PHPCSStandards/PHPCSExtra/graphs/contributors" } ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "description": "A collection of sniffs and standards for use with PHP_CodeSniffer.", "keywords": [ - "compatibility", - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" - }, - "time": "2019-12-27T09:44:58+00:00" - }, - { - "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.3", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", - "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", - "shasum": "" - }, - "require": { - "phpcompatibility/php-compatibility": "^9.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0", - "paragonie/random_compat": "dev-master", - "paragonie/sodium_compat": "dev-master" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" - } - ], - "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", - "homepage": "http://phpcompatibility.com/", - "keywords": [ - "compatibility", - "paragonie", + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", "phpcs", - "polyfill", "standards", "static analysis" ], "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", - "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + "issues": "https://github.com/PHPCSStandards/PHPCSExtra/issues", + "security": "https://github.com/PHPCSStandards/PHPCSExtra/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSExtra" }, "funding": [ { - "url": "https://github.com/PHPCompatibility", + "url": "https://github.com/PHPCSStandards", "type": "github" }, { @@ -941,67 +869,90 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2024-04-24T21:30:46+00:00" + "time": "2025-06-14T07:40:39+00:00" }, { - "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.5", + "name": "phpcsstandards/phpcsutils", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" + "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", + "reference": "f7eb16f2fa4237d5db9e8fed8050239bee17a9bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/f7eb16f2fa4237d5db9e8fed8050239bee17a9bd", + "reference": "f7eb16f2fa4237d5db9e8fed8050239bee17a9bd", "shasum": "" }, "require": { - "phpcompatibility/php-compatibility": "^9.0", - "phpcompatibility/phpcompatibility-paragonie": "^1.0" + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.13.0 || ^4.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "ext-filter": "*", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "phpcsstandards/phpcsdevcs": "^1.1.6", + "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0" }, "type": "phpcodesniffer-standard", + "extra": { + "branch-alias": { + "dev-stable": "1.x-dev", + "dev-develop": "1.x-dev" + } + }, + "autoload": { + "classmap": [ + "PHPCSUtils/" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { - "name": "Wim Godden", + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", "role": "lead" }, { - "name": "Juliette Reinders Folmer", - "role": "lead" + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHPCSUtils/graphs/contributors" } ], - "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", - "homepage": "http://phpcompatibility.com/", + "description": "A suite of utility functions for use with PHP_CodeSniffer", + "homepage": "https://phpcsutils.com/", "keywords": [ - "compatibility", + "PHP_CodeSniffer", + "phpcbf", + "phpcodesniffer-standard", "phpcs", + "phpcs3", + "phpcs4", "standards", "static analysis", - "wordpress" + "tokens", + "utility" ], "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", - "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + "docs": "https://phpcsutils.com/", + "issues": "https://github.com/PHPCSStandards/PHPCSUtils/issues", + "security": "https://github.com/PHPCSStandards/PHPCSUtils/security/policy", + "source": "https://github.com/PHPCSStandards/PHPCSUtils" }, "funding": [ { - "url": "https://github.com/PHPCompatibility", + "url": "https://github.com/PHPCSStandards", "type": "github" }, { @@ -1011,9 +962,13 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2024-04-24T21:37:59+00:00" + "time": "2025-08-10T01:04:45+00:00" }, { "name": "phpstan/phpstan", @@ -1075,35 +1030,35 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.31", + "version": "9.2.32", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -1112,7 +1067,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -1141,7 +1096,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -1149,7 +1104,7 @@ "type": "github" } ], - "time": "2024-03-02T06:37:42+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1394,45 +1349,45 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.19", + "version": "9.6.25", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8" + "reference": "049c011e01be805202d8eebedef49f769a8ec7b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1a54a473501ef4cdeaae4e06891674114d79db8", - "reference": "a1a54a473501ef4cdeaae4e06891674114d79db8", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/049c011e01be805202d8eebedef49f769a8ec7b7", + "reference": "049c011e01be805202d8eebedef49f769a8ec7b7", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1 || ^2", + "doctrine/instantiator": "^1.5.0 || ^2", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.28", - "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.3", - "phpunit/php-timer": "^5.0.2", - "sebastian/cli-parser": "^1.0.1", - "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.3", - "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.5", - "sebastian/global-state": "^5.0.1", - "sebastian/object-enumerator": "^4.0.3", - "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.2", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", + "sebastian/comparator": "^4.0.9", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.8", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", "sebastian/version": "^3.0.2" }, "suggest": { @@ -1477,7 +1432,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.19" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.25" }, "funding": [ { @@ -1488,12 +1443,20 @@ "url": "https://github.com/sebastianbergmann", "type": "github" }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, { "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", "type": "tidelift" } ], - "time": "2024-04-05T04:35:58+00:00" + "time": "2025-08-20T14:38:31+00:00" }, { "name": "sebastian/cli-parser", @@ -1664,16 +1627,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.8", + "version": "4.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5", + "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5", "shasum": "" }, "require": { @@ -1726,15 +1689,27 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.9" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" } ], - "time": "2022-09-14T12:41:17+00:00" + "time": "2025-08-10T06:51:50+00:00" }, { "name": "sebastian/complexity", @@ -2001,16 +1976,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.7", + "version": "5.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6", + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6", "shasum": "" }, "require": { @@ -2053,15 +2028,27 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state", + "type": "tidelift" } ], - "time": "2024-03-02T06:35:11+00:00" + "time": "2025-08-10T07:10:35+00:00" }, { "name": "sebastian/lines-of-code", @@ -2234,16 +2221,16 @@ }, { "name": "sebastian/recursion-context", - "version": "4.0.5", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0", + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0", "shasum": "" }, "require": { @@ -2285,15 +2272,27 @@ "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.6" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" } ], - "time": "2023-02-03T06:07:39+00:00" + "time": "2025-08-10T06:57:39+00:00" }, { "name": "sebastian/resource-operations", @@ -2460,16 +2459,16 @@ }, { "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.11.18", + "version": "v2.12.0", "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "ca242a0b7309e0f9d1f73b236e04ecf4ca3248d0" + "reference": "4debf5383d9ade705e0a25121f16c3fecaf433a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/ca242a0b7309e0f9d1f73b236e04ecf4ca3248d0", - "reference": "ca242a0b7309e0f9d1f73b236e04ecf4ca3248d0", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/4debf5383d9ade705e0a25121f16c3fecaf433a7", + "reference": "4debf5383d9ade705e0a25121f16c3fecaf433a7", "shasum": "" }, "require": { @@ -2480,9 +2479,8 @@ "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", "phpcsstandards/phpcsdevcs": "^1.1", "phpstan/phpstan": "^1.7", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", - "sirbrillig/phpcs-import-detection": "^1.1", - "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0 || ^10.5.32 || ^11.3.3", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0" }, "type": "phpcodesniffer-standard", "autoload": { @@ -2514,20 +2512,20 @@ "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2024-04-13T16:42:46+00:00" + "time": "2025-03-17T16:17:38+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.9.1", + "version": "3.13.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "267a4405fff1d9c847134db3a3c92f1ab7f77909" + "reference": "5b5e3821314f947dd040c70f7992a64eac89025c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/267a4405fff1d9c847134db3a3c92f1ab7f77909", - "reference": "267a4405fff1d9c847134db3a3c92f1ab7f77909", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5b5e3821314f947dd040c70f7992a64eac89025c", + "reference": "5b5e3821314f947dd040c70f7992a64eac89025c", "shasum": "" }, "require": { @@ -2592,9 +2590,13 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2024-03-31T21:03:09+00:00" + "time": "2025-06-17T22:17:01+00:00" }, { "name": "szepeviktor/phpstan-wordpress", @@ -2710,30 +2712,38 @@ }, { "name": "wp-coding-standards/wpcs", - "version": "2.3.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "7da1894633f168fe244afc6de00d141f27517b62" + "reference": "d2421de7cec3274ae622c22c744de9a62c7925af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", - "reference": "7da1894633f168fe244afc6de00d141f27517b62", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/d2421de7cec3274ae622c22c744de9a62c7925af", + "reference": "d2421de7cec3274ae622c22c744de9a62c7925af", "shasum": "" }, "require": { + "ext-filter": "*", + "ext-libxml": "*", + "ext-tokenizer": "*", + "ext-xmlreader": "*", "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.3.1" + "phpcsstandards/phpcsextra": "^1.4.0", + "phpcsstandards/phpcsutils": "^1.1.0", + "squizlabs/php_codesniffer": "^3.13.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", "phpcompatibility/php-compatibility": "^9.0", - "phpcsstandards/phpcsdevtools": "^1.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpcsstandards/phpcsdevtools": "^1.2.0", + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." + "ext-iconv": "For improved results", + "ext-mbstring": "For improved results" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -2750,6 +2760,7 @@ "keywords": [ "phpcs", "standards", + "static analysis", "wordpress" ], "support": { @@ -2757,94 +2768,26 @@ "source": "https://github.com/WordPress/WordPress-Coding-Standards", "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, - "time": "2020-05-13T23:57:56+00:00" - }, - { - "name": "wptrt/wpthemereview", - "version": "0.2.1", - "source": { - "type": "git", - "url": "https://github.com/WPTT/WPThemeReview.git", - "reference": "462e59020dad9399ed2fe8e61f2a21b5e206e420" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/WPTT/WPThemeReview/zipball/462e59020dad9399ed2fe8e61f2a21b5e206e420", - "reference": "462e59020dad9399ed2fe8e61f2a21b5e206e420", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "phpcompatibility/phpcompatibility-wp": "^2.0", - "squizlabs/php_codesniffer": "^3.3.1", - "wp-coding-standards/wpcs": "^2.2.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", - "phpcompatibility/php-compatibility": "^9.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0", - "roave/security-advisories": "dev-master" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Theme Review Team", - "homepage": "https://make.wordpress.org/themes/handbook/", - "role": "Strategy and rule setting" - }, - { - "name": "Ulrich Pogson", - "homepage": "https://github.com/grappler", - "role": "Lead developer" - }, - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "Lead developer" - }, - { - "name": "Denis Žoljom", - "homepage": "https://github.com/dingo-d", - "role": "Plugin integration lead" - }, + "funding": [ { - "name": "Contributors", - "homepage": "https://github.com/WPTRT/WPThemeReview/graphs/contributors" + "url": "https://opencollective.com/php_codesniffer", + "type": "custom" } ], - "description": "PHP_CodeSniffer rules (sniffs) to verify theme compliance with the rules for theme hosting on wordpress.org", - "homepage": "https://make.wordpress.org/themes/handbook/review/", - "keywords": [ - "phpcs", - "standards", - "themes", - "wordpress" - ], - "support": { - "issues": "https://github.com/WPTRT/WPThemeReview/issues", - "source": "https://github.com/WPTRT/WPThemeReview" - }, - "time": "2019-11-17T20:05:55+00:00" + "time": "2025-07-24T20:08:31+00:00" }, { "name": "yoast/phpunit-polyfills", - "version": "2.0.1", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "4a088f125c970d6d6ea52c927f96fe39b330d0f1" + "reference": "1a6aecc9ebe4a9cea4e1047d0e6c496e52314c27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/4a088f125c970d6d6ea52c927f96fe39b330d0f1", - "reference": "4a088f125c970d6d6ea52c927f96fe39b330d0f1", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/1a6aecc9ebe4a9cea4e1047d0e6c496e52314c27", + "reference": "1a6aecc9ebe4a9cea4e1047d0e6c496e52314c27", "shasum": "" }, "require": { @@ -2854,12 +2797,12 @@ "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.4.0", - "yoast/yoastcs": "^3.1.0" + "yoast/yoastcs": "^3.2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.x-dev" + "dev-main": "4.x-dev" } }, "autoload": { @@ -2894,13 +2837,12 @@ "security": "https://github.com/Yoast/PHPUnit-Polyfills/security/policy", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, - "time": "2024-04-05T16:36:44+00:00" + "time": "2025-08-10T05:13:49+00:00" } ], "aliases": [], "minimum-stability": "stable", "stability-flags": { - "codeinwp/phpcs-ruleset": 20, "codeinwp/twitteroauth": 20 }, "prefer-stable": false, diff --git a/cron-system/class-rop-cron-core.php b/cron-system/class-rop-cron-core.php index 0d6cf5b69..becc9d16f 100644 --- a/cron-system/class-rop-cron-core.php +++ b/cron-system/class-rop-cron-core.php @@ -31,7 +31,7 @@ class Rop_Cron_Core { /** * Rop_Cron_Core constructor. */ - function __construct() { + public function __construct() { /** * Register to ROP Cron the share start. @@ -53,7 +53,6 @@ function __construct() { * Register local end-points used by ROP Cron Service. */ add_action( 'init', array( &$this, 'init_endpoint_items' ) ); - } /** @@ -153,7 +152,5 @@ public function server_register_client() { 'request_path' => ':register_account:', ); $call_response = $request_call->create_call_process( $arguments ); - } - } diff --git a/cron-system/includes/class-debug-page.php b/cron-system/includes/class-debug-page.php index 38edb4a94..b196c8b7d 100644 --- a/cron-system/includes/class-debug-page.php +++ b/cron-system/includes/class-debug-page.php @@ -3,7 +3,6 @@ namespace RopCronSystem\Pages; - use RopCronSystem\Curl_Helpers\Rop_Curl_Methods; use RopCronSystem\ROP_Helpers\Rop_Helpers; @@ -27,7 +26,7 @@ class Debug_Page { * * Debug_Page constructor. */ - function __construct() { + public function __construct() { add_action( 'admin_menu', array( &$this, 'debug_page_menu' ) ); add_action( 'admin_enqueue_scripts', array( &$this, 'load_custom_wp_admin_style' ) ); @@ -163,58 +162,58 @@ public function rop_service_debug() { } ?> -
-

+
+


- - + + - - - + + + - - - + + + - +
' . __( 'PHP 7 is recommended', 'tweet-old-post' ) . ''; + echo ' ' . esc_html__( 'PHP 7 is recommended', 'tweet-old-post' ) . ''; } ?> -
+
'; - echo 'libz version: ' . $curl_version['libz_version'] . '
'; - echo 'OpenSSL: ' . $curl_version['ssl_version'] . '
'; + echo 'version: ' . esc_html( $curl_version['version'] ) . ' (' . esc_html( $curl_version['version_number'] ) . ')
'; + echo 'libz version: ' . esc_html( $curl_version['libz_version'] ) . '
'; + echo 'OpenSSL: ' . esc_html( $curl_version['ssl_version'] ) . '
'; echo 'Protocols:
'; // . implode( ',', $curl_version['protocols'] ) . '
'; echo 'HTTP: ' . ( ( in_array( 'http', $curl_version['protocols'] ) ) ? '' : '' ) . '
'; echo 'HTTPS: ' . ( ( in_array( 'https', $curl_version['protocols'] ) ) ? '' : '' ) . '
'; } else { - echo '' . __( 'No version of CURL detected.', 'tweet-old-post' ) . ''; + echo '' . esc_html__( 'No version of CURL detected.', 'tweet-old-post' ) . ''; } ?> -
+
Revive Social Cron SyStem: ', 'tweet-old-post' ); ?>
Revive Social Cron SyStem: ', 'tweet-old-post' ); ?> - Server:', 'tweet-old-post' ); ?> - N/A -
- WordPress:', 'tweet-old-post' ); ?> - N/A -
-
- + Server:', 'tweet-old-post' ); ?> + N/A +
+ WordPress:', 'tweet-old-post' ); ?> + N/A +
+
+

@@ -222,46 +221,46 @@ public function rop_service_debug() {
- + - +
- - + + - + -

+

-

+

- + - +
- - + + - + -

+

-

+

-
+
error = new Rop_Exception_Handler(); $this->logger = new Rop_Logger(); } @@ -115,9 +115,10 @@ public function create_call_process( $args = array() ) { if ( 'post' === strtolower( $args['type'] ) ) { - if ( ':delete_account:' !== $args['request_path'] ) { - // unset( $args['remove_location'] ); - } + // if ( ':delete_account:' !== $args['request_path'] ) { + // This condition is intentionally left for future use + // when we might need to handle specific request paths differently + // } $post_fields = array(); @@ -126,35 +127,32 @@ public function create_call_process( $args = array() ) { $this->server_url = self::SERVER_URL . $this->server_paths[ $args['request_path'] ]; $this->connection = curl_init( $this->server_url ); $this->register_to_top_server(); - } else { + } elseif ( empty( $token ) && ':delete_account:' !== $args['request_path'] ) { - if ( empty( $token ) && ':delete_account:' !== $args['request_path'] ) { $this->server_url = self::SERVER_URL . $this->server_paths[':register_account:']; $this->connection = curl_init( $this->server_url ); // If the request comes with "Stop cron" action, there's no need for it in account registration. - if ( ':disable_account:' === $args['request_path'] ) { - $args = array(); - } + if ( ':disable_account:' === $args['request_path'] ) { + $args = array(); + } $this->register_to_top_server( $args ); - } else { - - $this->server_url = self::SERVER_URL . $this->server_paths[ $args['request_path'] ]; - $this->connection = curl_init( $this->server_url ); + } else { - if ( isset( $args['time_to_share'] ) && ! empty( $args['time_to_share'] ) ) { - $post_fields = array( 'next_ping' => $args['time_to_share'] ); + $this->server_url = self::SERVER_URL . $this->server_paths[ $args['request_path'] ]; + $this->connection = curl_init( $this->server_url ); - } + if ( isset( $args['time_to_share'] ) && ! empty( $args['time_to_share'] ) ) { + $post_fields = array( 'next_ping' => $args['time_to_share'] ); - return $this->request_type_post( $post_fields, $args['request_path'] ); } + + return $this->request_type_post( $post_fields, $args['request_path'] ); } } return true; - } @@ -404,7 +402,6 @@ private function register_to_top_server( $callback_param = array() ) { return false; } - } /** @@ -447,7 +444,6 @@ private function fetch_attach_auth_token( $custom_value = '', $post_data = '' ) return false; } - } @@ -482,7 +478,6 @@ private function create_register_data() { $url_encode_data = http_build_query( $account_data ); return base64_encode( $url_encode_data ); - } /** @@ -490,7 +485,7 @@ private function create_register_data() { * * @since 8.5.5 */ - function __destruct() { + public function __destruct() { unset( $this->connection ); } } diff --git a/cron-system/includes/class-rop-helpers.php b/cron-system/includes/class-rop-helpers.php index 9a526c6ab..10fb218ff 100644 --- a/cron-system/includes/class-rop-helpers.php +++ b/cron-system/includes/class-rop-helpers.php @@ -2,7 +2,6 @@ namespace RopCronSystem\ROP_Helpers; - use Rop_Exception_Handler; use Rop_Logger; use Rop_Scheduler_Model; @@ -31,7 +30,7 @@ class Rop_Helpers { * @static * @since 8.5.5 */ - static public function extract_time_to_share() { + public static function extract_time_to_share() { // dates are stored into variable "rop_schedules_data". $scheduler = new Rop_Scheduler_Model(); @@ -82,7 +81,7 @@ static public function extract_time_to_share() { * @static * @since 8.5.5 */ - static public function local_timezone() { + public static function local_timezone() { // WordPress saves timezone in 2 different variables. // If it's UTC the option name is "". @@ -107,7 +106,7 @@ static public function local_timezone() { * @access public * @static */ - static public function apache_request_headers() { + public static function apache_request_headers() { $headers_output = array(); $headers_output_return = array(); if ( ! function_exists( 'apache_request_headers' ) ) { @@ -140,7 +139,7 @@ static public function apache_request_headers() { * * @return false|string */ - static public function openssl_random_pseudo_bytes( $count = 40 ) { + public static function openssl_random_pseudo_bytes( $count = 40 ) { if ( function_exists( 'openssl_random_pseudo_bytes' ) ) { return openssl_random_pseudo_bytes( $count ); } else { @@ -169,7 +168,7 @@ static public function openssl_random_pseudo_bytes( $count = 40 ) { * * @return bool|string */ - static public function custom_curl_post_request( $url = '', $post_arguments = array() ) { + public static function custom_curl_post_request( $url = '', $post_arguments = array() ) { $logger = new Rop_Logger(); @@ -284,5 +283,3 @@ static public function custom_curl_post_request( $url = '', $post_arguments = ar return $server_response_body; } } - - diff --git a/cron-system/rest-endpoints/class-rop-debug-ping.php b/cron-system/rest-endpoints/class-rop-debug-ping.php index b99ef44e2..4157bd2c3 100644 --- a/cron-system/rest-endpoints/class-rop-debug-ping.php +++ b/cron-system/rest-endpoints/class-rop-debug-ping.php @@ -135,5 +135,4 @@ public function catch_authorization_data_permissions() { public function init_rest_api_route() { add_action( 'rest_api_init', array( &$this, 'register_routes' ) ); } - } diff --git a/cron-system/rest-endpoints/class-rop-registration-check.php b/cron-system/rest-endpoints/class-rop-registration-check.php index e744b30f3..2fa3dac6a 100644 --- a/cron-system/rest-endpoints/class-rop-registration-check.php +++ b/cron-system/rest-endpoints/class-rop-registration-check.php @@ -141,5 +141,4 @@ public function catch_authorization_data_permissions() { public function init_rest_api_route() { add_action( 'rest_api_init', array( &$this, 'register_routes' ) ); } - } diff --git a/cron-system/rest-endpoints/class-rop-system-base.php b/cron-system/rest-endpoints/class-rop-system-base.php index b754e4b43..57d06c4e8 100644 --- a/cron-system/rest-endpoints/class-rop-system-base.php +++ b/cron-system/rest-endpoints/class-rop-system-base.php @@ -41,7 +41,7 @@ class Rop_System_Base extends WP_REST_Controller { * * Rop_System_Base constructor. */ - function __construct() { + public function __construct() { $this->error = new Rop_Exception_Handler(); $this->logger = new Rop_Logger(); } diff --git a/includes/admin/abstract/class-rop-model-abstract.php b/includes/admin/abstract/class-rop-model-abstract.php index ea9a47180..2583e483b 100644 --- a/includes/admin/abstract/class-rop-model-abstract.php +++ b/includes/admin/abstract/class-rop-model-abstract.php @@ -87,7 +87,7 @@ protected function set( $key, $value = '', $refresh = false ) { } if ( $refresh ) { - $this->data = get_option( 'rop_data' ); + $this->data = get_option( 'rop_data' ); } $this->data[ $key ] = apply_filters( 'rop_set_key_' . $key, $value ); @@ -132,5 +132,4 @@ protected function handle_underscore_exception( $index, $is_treat_any = false ) return $return_correct_format; } - } diff --git a/includes/admin/abstract/class-rop-services-abstract.php b/includes/admin/abstract/class-rop-services-abstract.php index 235cf6d0a..490cbc834 100644 --- a/includes/admin/abstract/class-rop-services-abstract.php +++ b/includes/admin/abstract/class-rop-services-abstract.php @@ -42,7 +42,7 @@ abstract class Rop_Services_Abstract { 'is_company' => false, 'img' => '', 'service' => '', - 'link' => '', + 'link' => '', ); /** * Stores the service details. @@ -110,7 +110,7 @@ abstract class Rop_Services_Abstract { public function __construct() { $this->error = new Rop_Exception_Handler(); $this->logger = new Rop_Logger(); - $this->user_default['created'] = date( 'd/m/Y H:i' ); + $this->user_default['created'] = gmdate( 'd/m/Y H:i' ); $this->user_default['service'] = $this->service_name; $this->init(); } @@ -122,7 +122,7 @@ public function __construct() { * @access public * @return mixed */ - public abstract function init(); + abstract public function init(); /** * Method to expose desired endpoints. @@ -133,7 +133,7 @@ public abstract function init(); * @access public * @return mixed */ - public abstract function expose_endpoints(); + abstract public function expose_endpoints(); /** * Method to retrieve the api object. @@ -142,7 +142,7 @@ public abstract function expose_endpoints(); * @access public * @return mixed */ - public abstract function get_api(); + abstract public function get_api(); /** * Method to define the api. @@ -151,7 +151,7 @@ public abstract function get_api(); * @access public * @return mixed */ - public abstract function set_api(); + abstract public function set_api(); /** @@ -162,7 +162,7 @@ public abstract function set_api(); * @return mixed * @param array $account The account details. See $user_default in Services Abstract. */ - public abstract function populate_additional_data( $account ); + abstract public function populate_additional_data( $account ); /** * Method for authorizing the service. @@ -201,7 +201,8 @@ public function authorize() { $this->error->throw_exception( 'Error', sprintf( 'The service "' . $this->display_name . '" can not be authorized %s', $exception->getMessage() ) ); } - exit( wp_redirect( admin_url( 'admin.php?page=TweetOldPost' ) ) ); + wp_redirect( admin_url( 'admin.php?page=TweetOldPost' ) ); + exit; } /** @@ -211,7 +212,7 @@ public function authorize() { * @access public * @return mixed */ - public abstract function maybe_authenticate(); + abstract public function maybe_authenticate(); /** * Returns information for the current service. @@ -220,7 +221,7 @@ public abstract function maybe_authenticate(); * @access public * @return mixed */ - public abstract function get_service(); + abstract public function get_service(); /** * Method for authenticate the service. @@ -229,7 +230,7 @@ public abstract function get_service(); * @access public * @return mixed */ - public abstract function authenticate( $args ); + abstract public function authenticate( $args ); /** * Method to register credentials for the service. @@ -239,7 +240,7 @@ public abstract function authenticate( $args ); * * @param array $args The credentials array. */ - public abstract function set_credentials( $args ); + abstract public function set_credentials( $args ); /** * Method for publishing with the service. @@ -251,7 +252,7 @@ public abstract function set_credentials( $args ); * @since 8.0.0 * @access public */ - public abstract function share( $post_details, $args = array() ); + abstract public function share( $post_details, $args = array() ); /** * Method to retrieve an endpoint URL. @@ -325,7 +326,6 @@ public function get_service_id() { } else { return $this->service_name . '_' . $service_details['id']; } - } /** @@ -345,7 +345,7 @@ public function share_as_first_comment( $url, $data = array() ) {} * @access protected * @return mixed */ - protected abstract function request_api_token(); + abstract protected function request_api_token(); /** * Method to generate url for service post share. @@ -435,8 +435,8 @@ function () use ( $path, $callback, $method ) { 'tweet-old-post/v8', '/' . $this->service_name . '/' . $path, array( - 'methods' => $method, - 'callback' => array( $this, $callback ), + 'methods' => $method, + 'callback' => array( $this, $callback ), 'permission_callback' => function () { return current_user_can( 'manage_options' ); }, @@ -537,11 +537,11 @@ protected function rop_get_error_docs( $response ) { $errors_docs = array( // Facebook errors - 'Only owners of the URL have the ability' => array( + 'Only owners of the URL have the ability' => array( 'message' => __( 'You need to verify your website with Facebook before sharing posts as article posts.', 'tweet-old-post' ), 'link' => 'https://is.gd/fix_owners_url', ), - 'manage_pages and publish_pages as an admin' => array( + 'manage_pages and publish_pages as an admin' => array( 'message' => __( 'You need to put your Facebook app through review.', 'tweet-old-post' ), 'link' => 'https://is.gd/fix_manage_pages_error', ), @@ -549,7 +549,7 @@ protected function rop_get_error_docs( $response ) { 'message' => __( 'You need to reconnect your Facebook account.', 'tweet-old-post' ), 'link' => 'https://is.gd/fix_fb_invalid_session', ), - 'Invalid parameter' => array( + 'Invalid parameter' => array( 'message' => 'There might be an issue with link creations on your website.', 'link' => 'https://is.gd/fix_link_issue', ), @@ -567,11 +567,11 @@ protected function rop_get_error_docs( $response ) { 'message' => 'Your Callback URL for your Twitter app might not be correct.', 'link' => 'https://is.gd/fix_oauth_callback_value', ), - 'User is over daily status update limit' => array( + 'User is over daily status update limit' => array( 'message' => 'You might be over your daily limit for sending tweets or our app has hit a limit.', 'link' => 'https://is.gd/fix_over_daily_limit', ), - 'Invalid media_id: Some' => array( + 'Invalid media_id: Some' => array( 'message' => 'Our plugin might be having an issue posting tweets with an image to your account.', 'link' => 'https://is.gd/fix_invalid_media', ), @@ -581,7 +581,7 @@ protected function rop_get_error_docs( $response ) { ), // LinkedIn errors - ''submitted-url' can not be empty' => array( + ''submitted-url' can not be empty' => array( 'message' => 'There might be an issue with link creations on your website.', 'link' => 'https://is.gd/fix_link_issue', ), @@ -589,7 +589,7 @@ protected function rop_get_error_docs( $response ) { 'message' => 'You might need to reconnect your LinkedIn account.', 'link' => 'https://is.gd/linkedin_scope_error', ), - 'The token used in the request has expired' => array( + 'The token used in the request has expired' => array( 'message' => 'You need to reconnect your LinkedIn account.', 'link' => 'https://is.gd/refresh_linkedin_token', ), @@ -626,7 +626,6 @@ protected function rop_get_error_docs( $response ) { $instructions = __( ' Please copy and paste the following link in your browser to see the solution: ', 'tweet-old-post' ); return $this->logger->alert_error( $known_error . $message . $instructions . $link ); - } /** @@ -670,7 +669,6 @@ protected function rop_download_external_image( $image_url ) { file_put_contents( $tmp_image_path, $image_contents ); return $tmp_image_path; - } /** @@ -900,7 +898,7 @@ protected function is_valid_serialize_data( $data ) { $valid = true; if ( is_array( $data ) ) { $data = array_map( - function( $d ) { + function ( $d ) { $d = base64_decode( $d, true ); $d = maybe_unserialize( $d, array( 'allowed_classes' => false ) ); if ( $d instanceof \__PHP_Incomplete_Class ) { @@ -966,5 +964,4 @@ public function save_logs_on_rop( $data = array() ) { $response_code = wp_remote_retrieve_response_code( $response ); return 200 === $response_code ? $body->status : false; } - } diff --git a/includes/admin/abstract/class-rop-url-shortner-abstract.php b/includes/admin/abstract/class-rop-url-shortner-abstract.php index 9840c8171..ccfbda6b3 100644 --- a/includes/admin/abstract/class-rop-url-shortner-abstract.php +++ b/includes/admin/abstract/class-rop-url-shortner-abstract.php @@ -75,7 +75,7 @@ public function __construct() { * @access public * @return mixed */ - public abstract function init(); + abstract public function init(); /** * Notify a save credentials action. @@ -139,7 +139,7 @@ public function set_credentials( $credentials ) { * * @return string */ - public abstract function shorten_url( $url ); + abstract public function shorten_url( $url ); /** * Utility method to generate a salt string. @@ -155,7 +155,7 @@ protected function getSalt() { $randStringLen = 64; $randString = ''; - for ( $i = 0; $i < $randStringLen; $i ++ ) { + for ( $i = 0; $i < $randStringLen; $i++ ) { $randString .= $charset[ mt_rand( 0, strlen( $charset ) - 1 ) ]; } diff --git a/includes/admin/class-rop-admin.php b/includes/admin/class-rop-admin.php index 0ec3f9bfc..a18d57dc7 100644 --- a/includes/admin/class-rop-admin.php +++ b/includes/admin/class-rop-admin.php @@ -65,7 +65,7 @@ public function __construct( $plugin_name = '', $version = '' ) { $global_settings = new Rop_Global_Settings(); add_filter( 'rop_pro_plan', - function() use ( $global_settings ) { + function () use ( $global_settings ) { return $global_settings->license_type(); } ); @@ -88,7 +88,7 @@ public function display_global_status_warning() {

: - +

plugin_name, ROP_LITE_URL . 'assets/css/rop.css', $deps, $this->version, 'all' ); wp_enqueue_style( $this->plugin_name . '_fa', ROP_LITE_URL . 'assets/css/font-awesome.min.css', array(), $this->version ); - } /** @@ -131,7 +130,7 @@ public function enqueue_styles() { */ public function check_shortener_service( $shortener ) { - $model = new Rop_Post_Format_Model; + $model = new Rop_Post_Format_Model(); $post_format = $model->get_post_format(); $shorteners = array(); @@ -169,7 +168,20 @@ public function bitly_shortener_upgrade_notice() { } ?>
- ', '', '', '', '', '

' ); ?> + tag, 2: tag, 3: tag, 4: tag with URL to docs, 5: tag, 6:

tag. + __( '%1$s%2$sRevive Social:%3$s Please upgrade your Bit.ly keys. See this %4$sarticle for instructions.%5$s%6$s', 'tweet-old-post' ), + '

', + '', + '', + '', + '', + '

' + ) + ); + ?>
get_selected_post_types(), 'value' ); $attachment_post_type = array_search( 'attachment', $post_types ); @@ -195,7 +207,6 @@ private function set_allowed_screens() { 'exclude' => 'rop_content_filters', 'publish_now' => $post_types, ); - } /** @@ -218,11 +229,9 @@ private function get_current_page() { break; } } - } else { - if ( strpos( $screen->id, $id ) !== false ) { + } elseif ( strpos( $screen->id, $id ) !== false ) { $page = $script; continue; - } } } @@ -312,7 +321,7 @@ public function enqueue_scripts() { } wp_enqueue_media(); - wp_register_script( $this->plugin_name . '-dashboard', ROP_LITE_URL . 'assets/js/build/dashboard.js', array('wp-url'), ( ROP_DEBUG ) ? time() : $this->version, false ); + wp_register_script( $this->plugin_name . '-dashboard', ROP_LITE_URL . 'assets/js/build/dashboard.js', array( 'wp-url' ), ( ROP_DEBUG ) ? time() : $this->version, false ); wp_register_script( $this->plugin_name . '-exclude', ROP_LITE_URL . 'assets/js/build/exclude.js', array(), ( ROP_DEBUG ) ? time() : $this->version, false ); $rop_api_settings = array( @@ -321,8 +330,8 @@ public function enqueue_scripts() { ); if ( current_user_can( 'manage_options' ) ) { $rop_api_settings = array( - 'root' => esc_url_raw( rest_url( '/tweet-old-post/v8/api/' ) ), - 'nonce' => wp_create_nonce( 'wp_rest' ), + 'root' => esc_url_raw( rest_url( '/tweet-old-post/v8/api/' ) ), + 'nonce' => wp_create_nonce( 'wp_rest' ), 'dashboard' => admin_url( 'admin.php?page=TweetOldPost' ), ); } @@ -370,9 +379,9 @@ public function enqueue_scripts() { $rop_api_settings['remote_cron_type_limit'] = $this->limit_remote_cron_system(); $rop_api_settings['exclude_apply_limit'] = $this->limit_exclude_list(); $rop_api_settings['publish_now'] = array( - 'instant_share_enabled' => $settings->get_instant_sharing(), + 'instant_share_enabled' => $settings->get_instant_sharing(), 'instant_share_by_default' => $settings->get_instant_sharing_by_default(), - 'accounts' => $active_accounts, + 'accounts' => $active_accounts, ); $rop_api_settings['custom_messages'] = $settings->get_custom_messages(); $rop_api_settings['added_networks'] = $added_networks; @@ -442,7 +451,7 @@ public function enqueue_scripts() { if ( ! defined( 'TI_E2E_TESTING' ) || ! TI_E2E_TESTING ) { add_filter( 'themeisle-sdk/survey/' . ROP_PRODUCT_SLUG, - function( $data, $page_slug ) use ( $accounts_count, $is_post_sharing_active ) { + function ( $data, $page_slug ) use ( $accounts_count, $is_post_sharing_active ) { $data = $this->get_survey_metadata(); $extra_attributes = array( @@ -500,7 +509,6 @@ public function rop_supported_mime_types() { $accepted_mime_types['all'] = array_merge( $image_mime_types, $video_mime_types, array( '' ) ); return $accepted_mime_types; - } /** @@ -549,7 +557,6 @@ public static function rop_site_is_staging( $post_id = '' ) { } return false; - } /** @@ -708,14 +715,17 @@ function () { } ); - global $submenu; - if ( isset( $submenu['TweetOldPost'] ) ) { - $submenu['TweetOldPost'][2] = array( - $rss_to_social, - 'manage_options', - tsdk_utmify( self::RN_LINK, 'admin', 'admin_menu' ), - ); - } + add_submenu_page( + 'TweetOldPost', + __( 'RSS to Social', 'tweet-old-post' ), + $rss_to_social, + 'manage_options', + 'rop_rss_to_social', + function () { + wp_redirect( esc_url_raw( tsdk_utmify( self::RN_LINK, 'admin', 'admin_menu' ) ) ); + exit; + } + ); } } @@ -730,19 +740,17 @@ public function publish_now_upsell() { if ( empty( $page ) ) { return; } - $global_settings = new Rop_Global_Settings; - $settings = new Rop_Settings_Model; + $global_settings = new Rop_Global_Settings(); + $settings = new Rop_Settings_Model(); $services = new Rop_Services_Model(); $active_accounts = $services->get_active_accounts(); if ( $settings->get_instant_sharing() && count( $active_accounts ) >= 2 && ! defined( 'ROP_PRO_VERSION' ) ) { - echo '
' . - __( - 'Share to more accounts by upgrading to the extended version for ', - 'tweet-old-post' - ) . 'Revive Social -
'; + echo '
' + . esc_html__( 'Share to more accounts by upgrading to the extended version for ', 'tweet-old-post' ) + . '' . esc_html( 'Revive Social' ) . '' + . '
'; } } @@ -871,7 +879,6 @@ public function rop_publish_now_metabox_html() { include_once ROP_LITE_PATH . '/includes/admin/views/publish_now.php'; $this->publish_now_upsell(); - } /** @@ -1083,7 +1090,7 @@ public function rop_cron_job_publish_now() { $pro_format_helper = false; if ( class_exists( 'Rop_Pro_Post_Format_Helper' ) && 0 < apply_filters( 'rop_pro_plan', -1 ) ) { - $pro_format_helper = new Rop_Pro_Post_Format_Helper; + $pro_format_helper = new Rop_Pro_Post_Format_Helper(); if ( method_exists( $pro_format_helper, 'set_content_helper' ) ) { $pro_format_helper->set_content_helper( new Rop_Content_Helper() ); } @@ -1338,11 +1345,23 @@ public function rop_linkedin_api_v2_notice() { ?>
- ', '', '', '', '', 'Dismiss', '

' ); ?> - + tag, 2: tag, 3: tag, 4: tag with URL to docs, 5: tag, 6: Dismiss link, 7:

tag. + __( '%1$s%2$sRevive Social:%3$s The Linkedin API Has been updated. You need to reconnect your LinkedIn account to continue posting to LinkedIn. Please see %4$sthis article for instructions.%5$s%6$s%7$s', 'tweet-old-post' ), + '

', + '', + '', + '', + '', + 'Dismiss', + '

' + ) + ); + ?>
- ', '', '', '', '', 'Dismiss', '

' ); ?> - + tag, 2: tag, 3: tag, 4: tag with URL to docs, 5: tag, 6: Dismiss link, 7:

tag. + __( '%1$s%2$sRevive Social:%3$s The WordPress Cron seems is disabled on your website. This can cause sharing issues with Revive Social. If sharing is not working, then see %4$shere for solutions.%5$s%6$s%7$s', 'tweet-old-post' ), + '

', + '', + '', + '', + '', + 'Dismiss', + '

' + ) + ); + ?>
- ', '', '', '', '', 'Dismiss', '

' ); ?> - + tag, 2: tag, 3: tag, 4: tag with URL to docs, 5: tag, 6: Dismiss link, 7:

tag. + __( '%1$s%2$sRevive Social:%3$s There might be an issue preventing Revive Social from sharing to your connected accounts. If sharing is not working, then see %4$shere for solutions.%5$s%6$s%7$s', 'tweet-old-post' ), + '

', + '', + '', + '', + '', + 'Dismiss', + '

' + ) + ); + ?>
get_more_than_once() ) { delete_option( 'rop_one_time_share_accounts' ); } - } /** @@ -1611,7 +1636,6 @@ private function rop_hide_add_own_app_option() { } return false; - } /** @@ -1628,7 +1652,6 @@ public function rop_get_wpml_active_status() { } else { return false; } - } /** @@ -1645,7 +1668,6 @@ public function rop_get_yoast_seo_active_status() { } else { return false; } - } /** @@ -1665,7 +1687,10 @@ public function rop_get_wpml_languages() { $languages_array = array(); foreach ( $languages as $key => $value ) { - $languages_array[] = array( 'code' => $key, 'label' => $value['native_name'] ); + $languages_array[] = array( + 'code' => $key, + 'label' => $value['native_name'], + ); } return $languages_array; } @@ -1700,7 +1725,7 @@ public function rop_wpml_filter_accounts( $post_id, $share_to_accounts ) { if ( empty( $rop_account_post_format['wpml_language'] ) ) { continue; - }; + } $rop_account_lang_code = $rop_account_post_format['wpml_language']; if ( class_exists( 'TRP_Translate_Press' ) ) { @@ -1711,7 +1736,6 @@ public function rop_wpml_filter_accounts( $post_id, $share_to_accounts ) { } return empty( $filtered_share_to_accounts ) ? $share_to_accounts : $filtered_share_to_accounts; - } /** @@ -1740,7 +1764,6 @@ public function rop_hide_pinterest_network_btn() { } return false; - } /** @@ -1760,7 +1783,6 @@ public function rop_is_edit_post_screen() { } return false; - } @@ -1966,8 +1988,8 @@ public function register_meta() { 'auth_callback' => $auth_can_edit_posts, 'show_in_rest' => array( 'schema' => array( - 'type' => 'object', - 'properties' => array(), // Leave blank to allow dynamic keys, or define expected keys + 'type' => 'object', + 'properties' => array(), // Leave blank to allow dynamic keys, or define expected keys 'additionalProperties' => array( 'type' => 'object', 'properties' => array( @@ -2051,7 +2073,7 @@ public function register_meta() { 'default' => array(), 'sanitize_callback' => $sanitize_passthrough, 'auth_callback' => $auth_can_edit_posts, - 'show_in_rest' => array( + 'show_in_rest' => array( 'schema' => array( 'type' => 'array', 'items' => array( @@ -2062,7 +2084,7 @@ public function register_meta() { 'timestamp' => array( 'type' => 'integer' ), 'status' => array( 'type' => 'string' ), ), - 'required' => array( 'account', 'service', 'timestamp', 'status' ), + 'required' => array( 'account', 'service', 'timestamp', 'status' ), ), ), ), diff --git a/includes/admin/class-rop-global-settings.php b/includes/admin/class-rop-global-settings.php index a8b815eaa..33cc4ffb8 100644 --- a/includes/admin/class-rop-global-settings.php +++ b/includes/admin/class-rop-global-settings.php @@ -109,51 +109,51 @@ class Rop_Global_Settings { 'allowed_comment' => false, ), 'linkedin' => array( - 'active' => false, - 'name' => 'LinkedIn', - 'allowed_comment' => false, + 'active' => false, + 'name' => 'LinkedIn', + 'allowed_comment' => false, ), 'tumblr' => array( - 'active' => false, - 'name' => 'Tumblr', - 'allowed_comment' => false, + 'active' => false, + 'name' => 'Tumblr', + 'allowed_comment' => false, ), 'pinterest' => array( - 'active' => false, - 'name' => 'Pinterest', - 'allowed_comment' => false, + 'active' => false, + 'name' => 'Pinterest', + 'allowed_comment' => false, ), - 'gmb' => array( - 'active' => false, - 'name' => 'Gmb', - 'fullname' => 'Google My Business', - 'allowed_comment' => false, + 'gmb' => array( + 'active' => false, + 'name' => 'Gmb', + 'fullname' => 'Google My Business', + 'allowed_comment' => false, ), - 'vk' => array( - 'active' => false, - 'name' => 'Vk', - 'allowed_comment' => false, + 'vk' => array( + 'active' => false, + 'name' => 'Vk', + 'allowed_comment' => false, ), - 'webhook' => array( - 'active' => false, - 'name' => 'Webhook', + 'webhook' => array( + 'active' => false, + 'name' => 'Webhook', 'two_step_sign_in' => true, 'allowed_comment' => false, ), - 'telegram' => array( - 'active' => false, - 'name' => 'Telegram', - 'allowed_comment' => false, + 'telegram' => array( + 'active' => false, + 'name' => 'Telegram', + 'allowed_comment' => false, ), - 'mastodon' => array( - 'active' => false, - 'name' => 'Mastodon', + 'mastodon' => array( + 'active' => false, + 'name' => 'Mastodon', 'two_step_sign_in' => true, 'allowed_comment' => false, ), - 'bluesky' => array( - 'active' => false, - 'name' => 'Bluesky', + 'bluesky' => array( + 'active' => false, + 'name' => 'Bluesky', 'two_step_sign_in' => true, 'allowed_comment' => false, ), @@ -167,30 +167,36 @@ class Rop_Global_Settings { * @var array $settings_defaults The class defaults for settings. */ private $settings_defaults = array( - 'default_interval' => 12, - 'min_interval' => 12, - 'step_interval' => 0.5, - 'minimum_post_age' => 30, - 'maximum_post_age' => 365, - 'number_of_posts' => 1, - 'more_than_once' => true, - 'available_post_types' => array(), - 'selected_post_types' => array( array( 'name' => 'Posts', 'value' => 'post', 'selected' => true ) ), - 'available_taxonomies' => array(), - 'selected_taxonomies' => array(), - 'exclude_taxonomies' => false, - 'available_posts' => array(), // get_posts(), - 'selected_posts' => array(), - 'exclude_posts' => true, - 'ga_tracking' => true, - 'beta_user' => false, - 'remote_check' => false, - 'custom_messages' => false, - 'custom_messages_share_order' => false, - 'instant_share' => true, - 'instant_share_default' => true, - 'start_time' => false, - 'minute_interval' => 5, + 'default_interval' => 12, + 'min_interval' => 12, + 'step_interval' => 0.5, + 'minimum_post_age' => 30, + 'maximum_post_age' => 365, + 'number_of_posts' => 1, + 'more_than_once' => true, + 'available_post_types' => array(), + 'selected_post_types' => array( + array( + 'name' => 'Posts', + 'value' => 'post', + 'selected' => true, + ), + ), + 'available_taxonomies' => array(), + 'selected_taxonomies' => array(), + 'exclude_taxonomies' => false, + 'available_posts' => array(), // get_posts(), + 'selected_posts' => array(), + 'exclude_posts' => true, + 'ga_tracking' => true, + 'beta_user' => false, + 'remote_check' => false, + 'custom_messages' => false, + 'custom_messages_share_order' => false, + 'instant_share' => true, + 'instant_share_default' => true, + 'start_time' => false, + 'minute_interval' => 5, ); /** @@ -226,7 +232,7 @@ class Rop_Global_Settings { 'share_link_text' => '', ), 'twitter' => array( - 'wpml_language' => '', + 'wpml_language' => '', 'post_content' => 'post_title', 'custom_meta_field' => '', 'maximum_length' => '240', @@ -247,8 +253,8 @@ class Rop_Global_Settings { 'utm_campaign_medium' => 'social', 'utm_campaign_name' => 'ReviveOldPost', ), - 'linkedin' => array( - 'wpml_language' => '', + 'linkedin' => array( + 'wpml_language' => '', 'post_content' => 'post_title', 'custom_meta_field' => '', 'maximum_length' => '1000', @@ -269,8 +275,8 @@ class Rop_Global_Settings { 'utm_campaign_medium' => 'social', 'utm_campaign_name' => 'ReviveOldPost', ), - 'tumblr' => array( - 'wpml_language' => '', + 'tumblr' => array( + 'wpml_language' => '', 'post_content' => 'post_title', 'custom_meta_field' => '', 'maximum_length' => '1000', @@ -291,8 +297,8 @@ class Rop_Global_Settings { 'utm_campaign_medium' => 'social', 'utm_campaign_name' => 'ReviveOldPost', ), - 'pinterest' => array( - 'wpml_language' => '', + 'pinterest' => array( + 'wpml_language' => '', 'post_content' => 'post_title', 'custom_meta_field' => '', 'maximum_length' => '1000', @@ -313,7 +319,7 @@ class Rop_Global_Settings { 'utm_campaign_medium' => 'social', 'utm_campaign_name' => 'ReviveOldPost', ), - 'gmb' => array( + 'gmb' => array( 'post_content' => 'post_title', 'custom_meta_field' => '', 'maximum_length' => '1000', @@ -334,8 +340,8 @@ class Rop_Global_Settings { 'utm_campaign_medium' => 'social', 'utm_campaign_name' => 'ReviveOldPost', ), - 'vk' => array( - 'wpml_language' => '', + 'vk' => array( + 'wpml_language' => '', 'post_content' => 'post_title', 'custom_meta_field' => '', 'maximum_length' => '1000', @@ -356,8 +362,8 @@ class Rop_Global_Settings { 'utm_campaign_medium' => 'social', 'utm_campaign_name' => 'ReviveOldPost', ), - 'webhook' => array( - 'wpml_language' => '', + 'webhook' => array( + 'wpml_language' => '', 'post_content' => 'post_title', 'custom_meta_field' => '', 'maximum_length' => '1000', @@ -422,7 +428,7 @@ class Rop_Global_Settings { 'utm_campaign_medium' => 'social', 'utm_campaign_name' => 'ReviveOldPost', ), - 'bluesky' => array( + 'bluesky' => array( 'wpml_language' => '', 'post_content' => 'post_title', 'custom_meta_field' => '', @@ -498,7 +504,7 @@ public function get_default_schedule() { */ public static function instance() { if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Rop_Global_Settings ) ) { - self::$instance = new Rop_Global_Settings; + self::$instance = new Rop_Global_Settings(); self::$instance->services = apply_filters( 'rop_available_services', self::$instance->services_defaults @@ -591,7 +597,7 @@ public function get_license_data_view() { } if ( isset( $license_data->expires ) ) { - $view_license_data['expires'] = date( 'F j, Y', strtotime( $license_data->expires ) ); + $view_license_data['expires'] = gmdate( 'F j, Y', strtotime( $license_data->expires ) ); if ( 'valid' === $view_license_data['license'] ) { $view_license_data['expires'] = sprintf( Rop_I18n::get_labels( 'general.expires' ), $view_license_data['expires'] ); } else { @@ -767,7 +773,6 @@ public function update_start_time() { $settings = $settings_model->get_settings(); $settings['start_time'] = time(); $settings_model->save_settings( $settings ); - } /** @@ -779,7 +784,6 @@ public function get_start_time() { $settings_model = new Rop_Settings_Model(); return $settings_model->get_start_time(); - } /** @@ -828,7 +832,7 @@ public function check_is_new_license() { } // Is after 9.1? - $created_at = strtotime( date( 'Y-m-d', strtotime( $license_data->created_at ) ) ); + $created_at = strtotime( gmdate( 'Y-m-d', strtotime( $license_data->created_at ) ) ); $compare_to = strtotime( '2024-07-21' ); return $created_at > $compare_to; diff --git a/includes/admin/class-rop-logger.php b/includes/admin/class-rop-logger.php index 209fc69de..76614b5d0 100644 --- a/includes/admin/class-rop-logger.php +++ b/includes/admin/class-rop-logger.php @@ -39,7 +39,6 @@ class Rop_Logger { public function __construct() { $this->stream = new Rop_Log_Handler( 'rop_logs' ); - } /** @@ -58,8 +57,8 @@ public function alert_success( $message = '', $context = array() ) { } $record = array( - 'channel' => 'rop_logs', - 'context' => array( + 'channel' => 'rop_logs', + 'context' => array( 'type' => 'success', ), 'formatted' => $message, @@ -84,8 +83,8 @@ public function alert_error( $message = '', $context = array() ) { } $record = array( - 'channel' => 'rop_logs', - 'context' => array( + 'channel' => 'rop_logs', + 'context' => array( 'type' => 'error', ), 'formatted' => $message, @@ -111,8 +110,8 @@ public function info( $message = '', $context = array() ) { } $record = array( - 'channel' => 'rop_logs', - 'context' => array( + 'channel' => 'rop_logs', + 'context' => array( 'type' => 'info', ), 'formatted' => $message, @@ -141,7 +140,6 @@ public function get_logs() { */ public function clear_user_logs() { $this->stream->clear_logs(); - } /** @@ -210,11 +208,11 @@ public function is_status_error_necessary( $logs = array() ) { foreach ( $data_logs as $log_entry ) { if ( 'error' === $log_entry['type'] ) { - $consecutive_errors ++; + ++$consecutive_errors; } else { break; } - $it ++; + ++$it; if ( $it >= ROP_STATUS_ALERT ) { break; @@ -227,7 +225,5 @@ public function is_status_error_necessary( $logs = array() ) { } return false; - } - } diff --git a/includes/admin/class-rop-pointers.php b/includes/admin/class-rop-pointers.php index 40aaf1355..82f4b632a 100644 --- a/includes/admin/class-rop-pointers.php +++ b/includes/admin/class-rop-pointers.php @@ -32,17 +32,17 @@ public function rop_setup_pointer_support() { public function rop_pointer_button_css() { $side = is_rtl() ? 'right' : 'left'; - echo " + echo ' - "; + '; } /** @@ -67,7 +67,7 @@ public function create_rop_menu_pointer() { 'next_trigger' => array(), 'options' => array( 'content' => '

' . esc_html__( 'Get Started', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'Click here to get started with Revive Social.', 'tweet-old-post' ) . '

', + '

' . esc_html__( 'Click here to get started with Revive Social.', 'tweet-old-post' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'left', @@ -105,7 +105,7 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Accounts Area', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'Your social media accounts will show here once connected.', 'tweet-old-post' ) . '

', + '

' . esc_html__( 'Your social media accounts will show here once connected.', 'tweet-old-post' ) . '

', 'position' => array( 'edge' => 'top', 'align' => 'left', @@ -121,7 +121,8 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Adding Accounts', 'tweet-old-post' ) . '

' . - '

' . sprintf( esc_html__( 'You can add your social media accounts here. %1$sLet\'s do this later%2$s.', 'tweet-old-post' ), '', '' ) . '

', + /* translators: %1$s and %2$s are opening and closing strong tags */ + '

' . sprintf( esc_html__( 'You can add your social media accounts here. %1$sLet\'s do this later%2$s.', 'tweet-old-post' ), '', '' ) . '

', 'position' => array( 'edge' => 'bottom', 'align' => 'left', @@ -137,7 +138,7 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'General Settings', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'This is the main configuration page of the plugin, we\'ll go through a few of the settings, click it now.', 'tweet-old-post' ) . '

', + '

' . esc_html__( 'This is the main configuration page of the plugin, we\'ll go through a few of the settings, click it now.', 'tweet-old-post' ) . '

', 'position' => array( 'edge' => 'top', 'align' => 'left', @@ -153,7 +154,7 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Time Between Shares', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'Here you can set how many hours you\'d like between shares.', 'tweet-old-post' ) . '

', + '

' . esc_html__( 'Here you can set how many hours you\'d like between shares.', 'tweet-old-post' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'right', @@ -169,7 +170,7 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Minimum Post Age', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'Here you can set how old posts should be before they are eligible to be shared.', 'tweet-old-post' ) . '

', + '

' . esc_html__( 'Here you can set how old posts should be before they are eligible to be shared.', 'tweet-old-post' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'right', @@ -185,8 +186,8 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Maximum Post Age', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'Here you can set the maximum age of posts that are eligible to be shared.', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'E.g. setting this option to 15 would mean that posts older than 15 days will not be shared.', 'tweet-old-post' ) . '

', + '

' . esc_html__( 'Here you can set the maximum age of posts that are eligible to be shared.', 'tweet-old-post' ) . '

' . + '

' . esc_html__( 'E.g. setting this option to 15 would mean that posts older than 15 days will not be shared.', 'tweet-old-post' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'right', @@ -202,7 +203,7 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Autopilot', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'Checking this option ensures that your posts share perpetually.', 'tweet-old-post' ) . '

', + '

' . esc_html__( 'Checking this option ensures that your posts share perpetually.', 'tweet-old-post' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'right', @@ -218,9 +219,10 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Post Types', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'Revive Social works with any post type, from products to posts, to custom post types.', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'You can share media straight from your media library!', 'tweet-old-post' ) . '

' . - '

' . sprintf( __( '%1$s%2$sLearn more about this feature%3$s%4$s.', 'tweet-old-post' ), '', '', '', '' ) . '

', + '

' . esc_html__( 'Revive Social works with any post type, from products to posts, to custom post types.', 'tweet-old-post' ) . '

' . + '

' . esc_html__( 'You can share media straight from your media library!', 'tweet-old-post' ) . '

' . + /* translators: %1$s, %2$s, %3$s and %4$s are opening and closing link/strong tags */ + '

' . sprintf( __( '%1$s%2$sLearn more about this feature%3$s%4$s.', 'tweet-old-post' ), '', '', '', '' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'right', @@ -236,10 +238,13 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Taxonomy Filtering', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'Here you can set which WordPress taxonomies you\'d like to include/exclude from sharing.', 'tweet-old-post' ) . '

' . - '

' . sprintf( __( '%1$sNote:%2$s', 'tweet-old-post' ), '', '' ) . '

' . - '

' . sprintf( __( 'Selecting options here and %1$schecking%2$s the Exclude box will %1$sprevent%2$s posts in those taxonomies from sharing.', 'tweet-old-post' ), '', '' ) . '

' . - '

' . sprintf( __( 'Selecting options here and leaving the Exclude box %1$sunchecked%2$s will %1$sonly share%2$s posts in those taxonomies.', 'tweet-old-post' ), '', '' ) . '

', + '

' . esc_html__( 'Here you can set which WordPress taxonomies you\'d like to include/exclude from sharing.', 'tweet-old-post' ) . '

' . + /* translators: %1$s and %2$s are opening and closing strong tags */ + '

' . sprintf( __( '%1$sNote:%2$s', 'tweet-old-post' ), '', '' ) . '

' . + /* translators: %1$s and %2$s are opening and closing strong tags */ + '

' . sprintf( __( 'Selecting options here and %1$schecking%2$s the Exclude box will %1$sprevent%2$s posts in those taxonomies from sharing.', 'tweet-old-post' ), '', '' ) . '

' . + /* translators: %1$s and %2$s are opening and closing strong tags */ + '

' . sprintf( __( 'Selecting options here and leaving the Exclude box %1$sunchecked%2$s will %1$sonly share%2$s posts in those taxonomies.', 'tweet-old-post' ), '', '' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'right', @@ -255,8 +260,9 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Share on Publish', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'Revive Social not only works on autopilot, it can also be used to push new posts to your social networks immediately.', 'tweet-old-post' ) . '

' . - '

' . sprintf( __( '%1$s%2$sLearn more about this feature%3$s%4$s.', 'tweet-old-post' ), '', '', '', '' ) . '

', + '

' . esc_html__( 'Revive Social not only works on autopilot, it can also be used to push new posts to your social networks immediately.', 'tweet-old-post' ) . '

' . + /* translators: %1$s, %2$s, %3$s and %4$s are opening and closing link/strong tags */ + '

' . sprintf( __( '%1$s%2$sLearn more about this feature%3$s%4$s.', 'tweet-old-post' ), '', '', '', '' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'right', @@ -272,8 +278,9 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Share Content Variations', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'You can add multiple custom messages to individual posts as share variations! Revive Social will randomly select one to share.', 'tweet-old-post' ) . '

' . - '

' . sprintf( __( '%1$s%2$sLearn more about this feature%3$s%4$s.', 'tweet-old-post' ), '', '', '', '' ) . '

', + '

' . esc_html__( 'You can add multiple custom messages to individual posts as share variations! Revive Social will randomly select one to share.', 'tweet-old-post' ) . '

' . + /* translators: %1$s, %2$s, %3$s and %4$s are opening and closing link/strong tags */ + '

' . sprintf( __( '%1$s%2$sLearn more about this feature%3$s%4$s.', 'tweet-old-post' ), '', '', '', '' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'right', @@ -289,7 +296,7 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Post Format', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'Once you\'ve connected an account(s) you\'ll be able to configure the settings for the account(s) here.', 'tweet-old-post' ) . '

', + '

' . esc_html__( 'Once you\'ve connected an account(s) you\'ll be able to configure the settings for the account(s) here.', 'tweet-old-post' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'right', @@ -305,8 +312,9 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Custom Schedule', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'Custom scheduling allows you to refine the post times and days of your posts.', 'tweet-old-post' ) . '

', - '

' . sprintf( __( '%1$s%2$sLearn more about this feature%3$s%4$s.', 'tweet-old-post' ), '', '', '', '' ) . '

', + '

' . esc_html__( 'Custom scheduling allows you to refine the post times and days of your posts.', 'tweet-old-post' ) . '

' . + /* translators: %1$s, %2$s, %3$s and %4$s are opening and closing link/strong tags */ + '

' . sprintf( __( '%1$s%2$sLearn more about this feature%3$s%4$s.', 'tweet-old-post' ), '', '', '', '' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'right', @@ -322,8 +330,9 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Sharing Queue', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'You\'ll be able to have look at the posts scheduled to go out by Revive Social. You can even skip or block them from sharing in the future.', 'tweet-old-post' ) . '

' . - '

' . sprintf( __( '%1$s%2$sLearn more about this feature%3$s%4$s.', 'tweet-old-post' ), '', '', '', '' ) . '

', + '

' . esc_html__( 'You\'ll be able to have look at the posts scheduled to go out by Revive Social. You can even skip or block them from sharing in the future.', 'tweet-old-post' ) . '

' . + /* translators: %1$s, %2$s, %3$s and %4$s are opening and closing link/strong tags */ + '

' . sprintf( __( '%1$s%2$sLearn more about this feature%3$s%4$s.', 'tweet-old-post' ), '', '', '', '' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'right', @@ -339,8 +348,9 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Share Log', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'You can track the success and failings of your shares here.', 'tweet-old-post' ) . '

' . - '

' . sprintf( __( 'The resolution to most of these possible errors can be found %1$s%2$sHere%3$s%4$s.', 'tweet-old-post' ), '', '', '', '' ) . '

', + '

' . esc_html__( 'You can track the success and failings of your shares here.', 'tweet-old-post' ) . '

' . + /* translators: %1$s, %2$s, %3$s and %4$s are opening and closing link/strong tags */ + '

' . sprintf( __( 'The resolution to most of these possible errors can be found %1$s%2$sHere%3$s%4$s.', 'tweet-old-post' ), '', '', '', '' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'right', @@ -356,7 +366,7 @@ public function create_rop_dashboard_pointers() { ), 'options' => array( 'content' => '

' . esc_html__( 'Start Sharing', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'Once you\'ve connected your accounts and setup their Post Format settings, use this button to start the plugin.', 'tweet-old-post' ) . '

', + '

' . esc_html__( 'Once you\'ve connected your accounts and setup their Post Format settings, use this button to start the plugin.', 'tweet-old-post' ) . '

', 'position' => array( 'edge' => 'right', 'align' => 'left', @@ -369,7 +379,7 @@ public function create_rop_dashboard_pointers() { 'next_trigger' => array(), 'options' => array( 'content' => '

' . esc_html__( 'Add Your Accounts', 'tweet-old-post' ) . '

' . - '

' . esc_html__( 'Switch to the accounts tab now to add your social media accounts to the plugin and begin sharing.', 'tweet-old-post' ) . '

', + '

' . esc_html__( 'Switch to the accounts tab now to add your social media accounts to the plugin and begin sharing.', 'tweet-old-post' ) . '

', 'position' => array( 'edge' => 'left', 'align' => 'right', @@ -398,7 +408,7 @@ public function rop_enqueue_pointers() { return; } - $general_settings = new Rop_Global_Settings; + $general_settings = new Rop_Global_Settings(); $is_plugin_screen = false; switch ( $screen->id ) { @@ -423,9 +433,9 @@ public function rop_enqueue_pointers() { response->set_code( '200' ) - ->set_data( $cron_helper->manage_cron( $data ) ); + ->set_data( $cron_helper->manage_cron( $data ) ); return $this->response->to_array(); } @@ -162,7 +162,7 @@ private function update_cron_type_agreement( $data ) { } $this->response->set_code( '200' ) - ->set_data( $response ); + ->set_data( $response ); return $this->response->to_array(); } @@ -237,7 +237,7 @@ private function get_queue( $data ) { $queue->clear_queue(); } $this->response->set_code( '200' ) - ->set_data( $queue->get_ordered_queue() ); + ->set_data( $queue->get_ordered_queue() ); return $this->response->to_array(); } @@ -288,7 +288,7 @@ private function reset_schedule( $data ) { $schedules = new Rop_Scheduler_Model(); $schedules->remove_schedule( $data['account_id'] ); $this->response->set_code( '201' ) - ->set_data( $schedules->get_schedule() ); + ->set_data( $schedules->get_schedule() ); return $this->response->is_not_silent()->to_array(); } @@ -308,7 +308,7 @@ private function reset_schedule( $data ) { private function get_schedule( $data ) { $schedules = new Rop_Scheduler_Model(); $this->response->set_code( '200' ) - ->set_data( $schedules->get_schedule() ); + ->set_data( $schedules->get_schedule() ); return $this->response->to_array(); } @@ -329,11 +329,11 @@ private function get_schedule( $data ) { private function get_shortner_credentials( $data ) { if ( empty( $data['short_url_service'] ) ) { return $this->response->set_code( '200' ) - ->set_data( array() )->to_array(); + ->set_data( array() )->to_array(); } if ( $data['short_url_service'] === 'wp_short_url' ) { return $this->response->set_code( '200' ) - ->set_data( array() )->to_array(); + ->set_data( array() )->to_array(); } $sh_factory = new Rop_Shortner_Factory(); @@ -343,7 +343,7 @@ private function get_shortner_credentials( $data ) { try { $shortner = $sh_factory->build( $data['short_url_service'] ); $this->response->set_code( '200' ) - ->set_data( $shortner->get_credentials( true ) ); + ->set_data( $shortner->get_credentials( true ) ); } catch ( Exception $exception ) { // Service not found or can't be built. Maybe log this exception. $log = new Rop_Logger(); @@ -461,7 +461,7 @@ private function reset_post_format( $data ) { private function get_post_format( $data ) { $post_format = new Rop_Post_Format_Model(); $this->response->set_code( '200' ) - ->set_data( $post_format->get_post_format() ); + ->set_data( $post_format->get_post_format() ); return $this->response->to_array(); } @@ -478,7 +478,7 @@ private function get_post_format( $data ) { private function select_posts() { $posts_selector = new Rop_Posts_Selector_Model(); $this->response->set_code( '200' ) - ->set_data( $posts_selector->select() ); + ->set_data( $posts_selector->select() ); return $this->response->to_array(); } @@ -495,7 +495,7 @@ private function select_posts() { private function get_general_settings() { $settings_model = new Rop_Settings_Model(); $this->response->set_code( '200' ) - ->set_data( $settings_model->get_settings( true ) ); + ->set_data( $settings_model->get_settings( true ) ); return $this->response->to_array(); } @@ -519,7 +519,7 @@ private function get_taxonomies( $data ) { $this->response->set_code( '400' ); if ( $taxonomies != false ) { $this->response->set_code( '200' ) - ->set_data( $taxonomies ); + ->set_data( $taxonomies ); } return $this->response->to_array(); @@ -548,7 +548,7 @@ private function exclude_post( $data ) { } $this->response->set_code( '200' ) - ->set_data( $data ); + ->set_data( $data ); return $this->response->to_array( $data ); } @@ -573,7 +573,7 @@ private function exclude_post_batch( $data ) { $settings_model->add_excluded_posts( $post_ids ); $this->response->set_code( '200' ) - ->set_data( $data ); + ->set_data( $data ); return $this->response->to_array( $data ); } @@ -625,7 +625,7 @@ private function save_general_settings( $data ) { $saved_data = $settings_model->get_settings(); $settings_model->save_settings( $data ); $this->response->set_code( '200' ) - ->set_data( $settings_model->get_settings() ); + ->set_data( $settings_model->get_settings() ); // Save tracking flag. $tracking = filter_var( $data['tracking'], FILTER_VALIDATE_BOOLEAN ); @@ -674,7 +674,7 @@ private function update_settings_toggle( $data ) { $general_settings['custom_messages'] = $data['custom_messages']; $settings_model->save_settings( $general_settings ); $this->response->set_code( '200' ) - ->set_data( $settings_model->get_settings() ); + ->set_data( $settings_model->get_settings() ); return $this->response->to_array(); } @@ -691,7 +691,7 @@ private function update_settings_toggle( $data ) { private function get_available_services() { $global_settings = new Rop_Global_Settings(); $this->response->set_code( '200' ) - ->set_data( $global_settings->get_available_services() ); + ->set_data( $global_settings->get_available_services() ); return $this->response->to_array(); } @@ -708,7 +708,7 @@ private function get_available_services() { private function get_authenticated_services() { $model = new Rop_Services_Model(); $this->response->set_code( '200' ) - ->set_data( $model->get_authenticated_services() ); + ->set_data( $model->get_authenticated_services() ); return $this->response->to_array(); } @@ -750,7 +750,7 @@ private function get_active_accounts() { } $this->response->set_code( '200' ) - ->set_data( $valid_accounts ); + ->set_data( $valid_accounts ); return $this->response->to_array(); } @@ -768,7 +768,7 @@ private function reset_accounts() { $model = new Rop_Services_Model(); $model->reset_authenticated_services(); $this->response->set_code( '200' ) - ->set_data( array() ); + ->set_data( array() ); return $this->response->to_array(); } @@ -793,7 +793,7 @@ private function update_active_accounts( $data ) { } $model = new Rop_Services_Model(); $this->response->set_code( '200' ) - ->set_data( $model->add_active_accounts( $new_active ) ); + ->set_data( $model->add_active_accounts( $new_active ) ); return $this->response->to_array(); } @@ -818,7 +818,7 @@ private function toggle_account( $data ) { $model->delete_active_accounts( $data['account_id'] ); } $this->response->set_code( '200' ) - ->set_data( $data ); + ->set_data( $data ); return $this->response->to_array(); } @@ -832,7 +832,7 @@ private function toggle_account( $data ) { */ private function remove_account( $data ) { $this->response->set_code( '200' ) - ->set_data( $data ); + ->set_data( $data ); $model = new Rop_Services_Model(); $model->remove_service_account( $data['account_id'] ); @@ -964,7 +964,7 @@ private function get_log( $data ) { $log->clear_user_logs(); } $this->response->set_code( '200' ) - ->set_data( $log->get_logs() ); + ->set_data( $log->get_logs() ); return $this->response->to_array(); } @@ -979,8 +979,8 @@ private function get_log( $data ) { private function fb_exception_toast( $data ) { update_option( 'rop_facebook_domain_toast', 'no' ); $this->response->set_code( '200' ) - ->set_message( 'Facebook domain check toast new status is closed' ) - ->set_data( array( 'display' => false ) ); + ->set_message( 'Facebook domain check toast new status is closed' ) + ->set_data( array( 'display' => false ) ); return $this->response->to_array(); } @@ -998,8 +998,8 @@ private function get_toast( $data ) { $log = new Rop_Logger(); $this->response->set_code( '200' ) - ->set_message( 'OK' ) - ->set_data( $log->get_logs() ); + ->set_message( 'OK' ) + ->set_data( $log->get_logs() ); $logs_response = $this->response->to_array(); @@ -1029,7 +1029,7 @@ private function get_toast( $data ) { $logs_response['data'][] = $latest_log_entry; // Add the timestamp of the error into DB to now show this alert multiple times. update_option( 'rop_toast', $time, 'no' ); - $custom_response ++; + ++$custom_response; } } } @@ -1037,7 +1037,7 @@ private function get_toast( $data ) { // We need to inform the user as there are many errors in the log // This will change the status to "Error (check logs)" if ( true === $is_status_logs_alert ) { - $custom_response ++; + ++$custom_response; $logs_response['data'][] = array( 'type' => 'status_error', 'message' => '', @@ -1091,18 +1091,18 @@ private function add_account_fb( $data ) { $db->migrate_post_formats( $active_accounts ); } else { $this->response->set_code( '500' ) - ->set_data( array() ); + ->set_data( array() ); return $this->response->to_array(); } $this->response->set_code( '200' ) - ->set_message( 'OK' ) - ->set_data( array() ); + ->set_message( 'OK' ) + ->set_data( array() ); $rop_facebook_via_rs_app_option = 'rop_facebook_via_rs_app'; if ( ! get_option( $rop_facebook_via_rs_app_option ) ) { - add_option( $rop_facebook_via_rs_app_option, 'true', ' ', 'no' ); + add_option( $rop_facebook_via_rs_app_option, 'true', '', 'no' ); } else { update_option( $rop_facebook_via_rs_app_option, 'true' ); } @@ -1148,18 +1148,18 @@ private function add_account_tw( $data ) { $db->migrate_post_formats( $active_accounts ); } else { $this->response->set_code( '500' ) - ->set_data( array() ); + ->set_data( array() ); return $this->response->to_array(); } $this->response->set_code( '200' ) - ->set_message( 'OK' ) - ->set_data( array() ); + ->set_message( 'OK' ) + ->set_data( array() ); $rop_twitter_via_rs_app_option = 'rop_twitter_via_rs_app'; if ( ! get_option( $rop_twitter_via_rs_app_option ) ) { - add_option( $rop_twitter_via_rs_app_option, 'true', ' ', 'no' ); + add_option( $rop_twitter_via_rs_app_option, 'true', '', 'no' ); } else { update_option( $rop_twitter_via_rs_app_option, 'true' ); } @@ -1201,18 +1201,18 @@ private function add_account_li( $data ) { $db->migrate_post_formats( $active_accounts ); } else { $this->response->set_code( '500' ) - ->set_data( array() ); + ->set_data( array() ); return $this->response->to_array(); } $this->response->set_code( '200' ) - ->set_message( 'OK' ) - ->set_data( array() ); + ->set_message( 'OK' ) + ->set_data( array() ); $rop_linkedin_via_rs_app_option = 'rop_linkedin_via_rs_app'; if ( ! get_option( $rop_linkedin_via_rs_app_option ) ) { - add_option( $rop_linkedin_via_rs_app_option, 'true', ' ', 'no' ); + add_option( $rop_linkedin_via_rs_app_option, 'true', '', 'no' ); } else { update_option( $rop_linkedin_via_rs_app_option, 'true' ); } @@ -1253,18 +1253,18 @@ private function add_account_tumblr( $data ) { $db->migrate_post_formats( $active_accounts ); } else { $this->response->set_code( '500' ) - ->set_data( array() ); + ->set_data( array() ); return $this->response->to_array(); } $this->response->set_code( '200' ) - ->set_message( 'OK' ) - ->set_data( array() ); + ->set_message( 'OK' ) + ->set_data( array() ); $rop_tumblr_via_rs_app_option = 'rop_tumblr_via_rs_app'; if ( ! get_option( $rop_tumblr_via_rs_app_option ) ) { - add_option( $rop_tumblr_via_rs_app_option, 'true', ' ', 'no' ); + add_option( $rop_tumblr_via_rs_app_option, 'true', '', 'no' ); } else { update_option( $rop_tumblr_via_rs_app_option, 'true' ); } @@ -1305,14 +1305,14 @@ private function add_account_gmb( $data ) { $db->migrate_post_formats( $active_accounts ); } else { $this->response->set_code( '500' ) - ->set_data( array() ); + ->set_data( array() ); return $this->response->to_array(); } $this->response->set_code( '200' ) - ->set_message( 'OK' ) - ->set_data( array() ); + ->set_message( 'OK' ) + ->set_data( array() ); return $this->response->to_array(); } @@ -1349,14 +1349,14 @@ private function add_account_vk( $data ) { $db->migrate_post_formats( $active_accounts ); } else { $this->response->set_code( '500' ) - ->set_data( array() ); + ->set_data( array() ); return $this->response->to_array(); } $this->response->set_code( '200' ) - ->set_message( 'OK' ) - ->set_data( array() ); + ->set_message( 'OK' ) + ->set_data( array() ); return $this->response->to_array(); } @@ -1378,14 +1378,19 @@ private function set_license( $data ) { $this->response ->set_code( '403' ) ->set_message( 'Forbidden' ) - ->set_data( array( 'success' => false, 'message' => Rop_I18n::get_labels( 'general.no_permission' ) ) ); + ->set_data( + array( + 'success' => false, + 'message' => Rop_I18n::get_labels( 'general.no_permission' ), + ) + ); return $this->response->to_array(); } // NOTE: The license processor requires the license key, even if we want to deactivate the license. if ( empty( $data['license_key'] ) ) { - $general_settings = new Rop_Global_Settings; + $general_settings = new Rop_Global_Settings(); $license_data = $general_settings->get_license_data(); if ( ! empty( $license_data ) && isset( $license_data->key ) ) { $data['license_key'] = $license_data->key; @@ -1396,7 +1401,12 @@ private function set_license( $data ) { if ( is_wp_error( $response ) ) { return $this->response - ->set_data( array( 'success' => false, 'message' => 'activate' === $data['action'] ? Rop_I18n::get_labels( 'general.validation_failed' ) : Rop_I18n::get_labels( 'general.could_not_change_license' ) ) ) + ->set_data( + array( + 'success' => false, + 'message' => 'activate' === $data['action'] ? Rop_I18n::get_labels( 'general.validation_failed' ) : Rop_I18n::get_labels( 'general.could_not_change_license' ), + ) + ) ->to_array(); } @@ -1426,7 +1436,7 @@ private function add_account_webhook( $data ) { if ( ! $webhook_service->add_webhook( $data ) ) { $this->response->set_code( '422' ) - ->set_data( array() ); + ->set_data( array() ); return $this->response->to_array(); } @@ -1443,14 +1453,14 @@ private function add_account_webhook( $data ) { $db->migrate_post_formats( $active_accounts ); } else { $this->response->set_code( '500' ) - ->set_data( array() ); + ->set_data( array() ); return $this->response->to_array(); } $this->response->set_code( '200' ) - ->set_message( 'OK' ) - ->set_data( array() ); + ->set_message( 'OK' ) + ->set_data( array() ); return $this->response->to_array(); } @@ -1473,7 +1483,7 @@ private function edit_account_webhook( $data ) { if ( ! $webhook_service->add_webhook( $data ) ) { $this->response->set_code( '422' ) - ->set_data( array() ); + ->set_data( array() ); return $this->response->to_array(); } @@ -1483,7 +1493,7 @@ private function edit_account_webhook( $data ) { if ( ! isset( $authenticated_services[ $service_id ] ) ) { $this->response->set_code( '422' ) - ->set_data( array() ); + ->set_data( array() ); return $this->response->to_array(); } @@ -1497,8 +1507,8 @@ private function edit_account_webhook( $data ) { } $this->response->set_code( '200' ) - ->set_message( 'OK' ) - ->set_data( array() ); + ->set_message( 'OK' ) + ->set_data( array() ); return $this->response->to_array(); } @@ -1636,8 +1646,8 @@ private function add_account_bluesky( $data ) { } $this->response->set_code( '200' ) - ->set_message( 'OK' ) - ->set_data( array() ); + ->set_message( 'OK' ) + ->set_data( array() ); return $this->response->to_array(); } diff --git a/includes/admin/class-rop-services-factory.php b/includes/admin/class-rop-services-factory.php index d959ec286..052b6fc08 100644 --- a/includes/admin/class-rop-services-factory.php +++ b/includes/admin/class-rop-services-factory.php @@ -31,7 +31,7 @@ class Rop_Services_Factory { public static function build( $service_name ) { $service = 'Rop_' . str_replace( '-', '_', ucwords( $service_name ) ) . '_Service'; if ( class_exists( $service ) ) { - return new $service; + return new $service(); } // @codeCoverageIgnoreStart throw new Exception( 'Invalid service name given.' ); diff --git a/includes/admin/class-rop-shortner-factory.php b/includes/admin/class-rop-shortner-factory.php index 0c4bacea7..a25bf1179 100644 --- a/includes/admin/class-rop-shortner-factory.php +++ b/includes/admin/class-rop-shortner-factory.php @@ -31,7 +31,7 @@ class Rop_Shortner_Factory { public static function build( $shortner_name ) { $shortner = 'Rop_' . ucwords( str_replace( '.', '', $shortner_name ) ) . '_Shortner'; if ( class_exists( $shortner ) ) { - return new $shortner; + return new $shortner(); } // @codeCoverageIgnoreStart throw new Exception( 'Invalid shortener name given.' ); diff --git a/includes/admin/helpers/class-rop-bluesky-api.php b/includes/admin/helpers/class-rop-bluesky-api.php index da2cd5665..fdb48de50 100644 --- a/includes/admin/helpers/class-rop-bluesky-api.php +++ b/includes/admin/helpers/class-rop-bluesky-api.php @@ -232,8 +232,8 @@ public function get_user_details( $did, $access_token = '' ) { "{$this->api_url}/app.bsky.actor.getProfile?" . http_build_query( array( 'actor' => $did ) ), array( 'headers' => array( - 'Content-Type' => 'application/json', - 'timeout' => 120, + 'Content-Type' => 'application/json', + 'timeout' => 120, 'Authorization' => 'Bearer ' . $access_token, ), ) @@ -298,7 +298,7 @@ public function create_post( $did, $post, $post_type, $hashtags, $access_token = if ( $post_type === 'link' && isset( $post['post_url'] ) && ! empty( $post['post_url'] ) ) { $record['embed'] = array( - '$type' => 'app.bsky.embed.external', + '$type' => 'app.bsky.embed.external', 'external' => array( 'uri' => $post['post_url'], 'title' => isset( $post['title'] ) ? $post['title'] : '', @@ -324,7 +324,7 @@ public function create_post( $did, $post, $post_type, $hashtags, $access_token = if ( false !== $image_blob ) { $record['embed'] = array( - '$type' => 'app.bsky.embed.images', + '$type' => 'app.bsky.embed.images', 'images' => array( array( 'alt' => isset( $post['title'] ) ? $post['title'] : '', diff --git a/includes/admin/helpers/class-rop-content-helper.php b/includes/admin/helpers/class-rop-content-helper.php index d8cb3d076..31c5cb505 100644 --- a/includes/admin/helpers/class-rop-content-helper.php +++ b/includes/admin/helpers/class-rop-content-helper.php @@ -115,7 +115,7 @@ public function token_truncate( $string, $new_length = false ) { $parts_count = count( $parts ); $length = 0; - for ( $last_part = 0; $last_part < $parts_count; ++ $last_part ) { + for ( $last_part = 0; $last_part < $parts_count; ++$last_part ) { $length += strlen( $parts[ $last_part ] ); if ( $length > $this->length ) { break; @@ -155,7 +155,7 @@ public function token_truncate( $string, $new_length = false ) { public function mark_hashtags( $string, $hashtag ) { $location = stripos( $string, ' ' . $hashtag . ' ' ); if ( $location !== false ) { - $location ++; // the actual # location will be past the space + ++$location; // the actual # location will be past the space } elseif ( stripos( $string, $hashtag . ' ' ) === 0 ) { // see if the hashtag is at the beginning $location = 0; @@ -169,5 +169,4 @@ public function mark_hashtags( $string, $hashtag ) { return false; } - } diff --git a/includes/admin/helpers/class-rop-cron-helper.php b/includes/admin/helpers/class-rop-cron-helper.php index 3ed2faddb..12ac06190 100644 --- a/includes/admin/helpers/class-rop-cron-helper.php +++ b/includes/admin/helpers/class-rop-cron-helper.php @@ -277,7 +277,7 @@ public static function get_schedule_key( $namespace ) { * * @since 8.5.0 */ - function cron_status_global_change( $action = false ) { + public function cron_status_global_change( $action = false ) { $key = 'rop_is_sharing_cron_active'; $cron_status = ( true === $action ) ? 'yes' : 'no'; @@ -296,7 +296,6 @@ public function get_status() { } else { return is_int( $this->is_scheduled( self::CRON_NAMESPACE ) ); } - } /** diff --git a/includes/admin/helpers/class-rop-db-upgrade.php b/includes/admin/helpers/class-rop-db-upgrade.php index ce9c0f902..67f338ffa 100644 --- a/includes/admin/helpers/class-rop-db-upgrade.php +++ b/includes/admin/helpers/class-rop-db-upgrade.php @@ -57,7 +57,6 @@ public function is_upgrade_required() { return false; } - } /** @@ -177,7 +176,6 @@ public function migrate_accounts() { $this->migrate_post_formats( $active_accounts ); } }// End if(). - } /** @@ -471,5 +469,4 @@ function ( $d ) use ( $column_key, $index_key ) { $cron->create_cron( true ); } } - } diff --git a/includes/admin/helpers/class-rop-exception-handler.php b/includes/admin/helpers/class-rop-exception-handler.php index e8316775e..708686e4a 100644 --- a/includes/admin/helpers/class-rop-exception-handler.php +++ b/includes/admin/helpers/class-rop-exception-handler.php @@ -91,8 +91,7 @@ public function throw_exception( $header, $message ) { } header( 'HTTP/1.0 ' . $header ); $backtrace = wp_debug_backtrace_summary(); - echo $message . ' BackTrace: ' . $backtrace; + echo esc_html( $message ) . ' BackTrace: ' . esc_html( $backtrace ); exit; } - } diff --git a/includes/admin/helpers/class-rop-log-handler.php b/includes/admin/helpers/class-rop-log-handler.php index c866adfa9..ed5be4571 100644 --- a/includes/admin/helpers/class-rop-log-handler.php +++ b/includes/admin/helpers/class-rop-log-handler.php @@ -19,7 +19,7 @@ class Rop_Log_Handler { * * @var array $current_logs List of logs. */ - static private $current_logs; + private static $current_logs; /** * Hold initialization status. * diff --git a/includes/admin/helpers/class-rop-post-format-helper.php b/includes/admin/helpers/class-rop-post-format-helper.php index bffaeacc2..283dcecaa 100644 --- a/includes/admin/helpers/class-rop-post-format-helper.php +++ b/includes/admin/helpers/class-rop-post-format-helper.php @@ -63,14 +63,12 @@ class Rop_Post_Format_Helper { public function get_formated_object( $post_id, $account_id = 0 ) { if ( ! empty( $account_id ) ) { $this->set_post_format( $account_id ); - } else { - if ( empty( $this->post_format ) ) { + } elseif ( empty( $this->post_format ) ) { return array(); - } } if ( function_exists( 'icl_object_id' ) || class_exists( 'TRP_Translate_Press' ) ) { - $selector = new Rop_Posts_Selector_Model; + $selector = new Rop_Posts_Selector_Model(); $post_id = $selector->rop_wpml_id( $post_id, $this->account_id ); } @@ -153,7 +151,7 @@ public function build_content( $post_id ) { $max_length = $this->post_format['maximum_length']; if ( class_exists( 'Rop_Pro_Post_Format_Helper' ) && 0 < apply_filters( 'rop_pro_plan', -1 ) ) { - $pro_format_helper = new Rop_Pro_Post_Format_Helper; + $pro_format_helper = new Rop_Pro_Post_Format_Helper(); if ( method_exists( $pro_format_helper, 'set_content_helper' ) ) { $pro_format_helper->set_content_helper( $content_helper ); @@ -274,7 +272,6 @@ public function build_content( $post_id ) { ); return $response; - } /** @@ -417,7 +414,6 @@ private function get_custom_length() { } return $this->string_length( $this->post_format['custom_text'] ) + 1; // For the extra space - } /** @@ -496,7 +492,7 @@ function ( $value ) { foreach ( $result as $hashtag ) { if ( $content_helper->mark_hashtags( $content, $hashtag ) !== false && 'tumblr' !== $service ) { // if the hashtag exists in $content $content = $content_helper->mark_hashtags( $content, $hashtag ); // simply add a # there - $hashtags_length --; // subtract 1 for the # we added to $content + --$hashtags_length; // subtract 1 for the # we added to $content } elseif ( $this->string_length( $hashtag . $hashtags ) <= $hashtags_length || $hashtags_length == 0 ) { $hashtags = $hashtags . ' #' . preg_replace( '/-/', '', $hashtag ); } @@ -507,7 +503,6 @@ function ( $value ) { 'hashtags' => $hashtags, 'content' => $content, ); - } /** @@ -540,7 +535,7 @@ private function get_common_hashtags() { private function get_categories_hashtags( $post_id ) { if ( class_exists( 'Rop_Pro_Post_Format_Helper' ) && 0 < apply_filters( 'rop_pro_plan', -1 ) ) { - $pro_format_helper = new Rop_Pro_Post_Format_Helper; + $pro_format_helper = new Rop_Pro_Post_Format_Helper(); } if ( ! isset( $pro_format_helper ) ) { @@ -553,7 +548,6 @@ private function get_categories_hashtags( $post_id ) { } else { return $pro_format_helper->pro_get_categories_hashtags( $post_id ); } - } /** @@ -569,7 +563,7 @@ private function get_categories_hashtags( $post_id ) { private function get_tags_hashtags( $post_id ) { if ( class_exists( 'Rop_Pro_Post_Format_Helper' ) && 0 < apply_filters( 'rop_pro_plan', -1 ) ) { - $pro_format_helper = new Rop_Pro_Post_Format_Helper; + $pro_format_helper = new Rop_Pro_Post_Format_Helper(); } if ( ! isset( $pro_format_helper ) ) { @@ -582,7 +576,6 @@ private function get_tags_hashtags( $post_id ) { } else { return $pro_format_helper->pro_get_tags_hashtags( $post_id ); } - } /** @@ -792,7 +785,7 @@ public static function valid_hashtag_regex() { private function append_custom_text( $content, $post_id ) { if ( class_exists( 'Rop_Pro_Post_Format_Helper' ) && 0 < apply_filters( 'rop_pro_plan', -1 ) ) { - $pro_format_helper = new Rop_Pro_Post_Format_Helper; + $pro_format_helper = new Rop_Pro_Post_Format_Helper(); if ( method_exists( $pro_format_helper, 'set_content_helper' ) ) { $pro_format_helper->set_content_helper( new Rop_Content_Helper() ); @@ -845,7 +838,7 @@ public function build_url( $post_id ) { // WPML compatibility if ( function_exists( 'icl_object_id' ) || class_exists( 'TRP_Translate_Press' ) ) { - $selector = new Rop_Posts_Selector_Model; + $selector = new Rop_Posts_Selector_Model(); $post_url = $selector->rop_wpml_link( $post_url, $this->account_id ); } @@ -924,7 +917,6 @@ public function rop_prepare_utm_link( $post_url, $free = true ) { } return $post_url; - } /** @@ -1098,5 +1090,4 @@ private function get_translate_content( $content ) { $translation_render = $trp->get_component( 'translation_render' ); return $translation_render->translate_page( $content ); } - } diff --git a/includes/admin/models/class-rop-api-response.php b/includes/admin/models/class-rop-api-response.php index 4fa724319..fee5a0174 100644 --- a/includes/admin/models/class-rop-api-response.php +++ b/includes/admin/models/class-rop-api-response.php @@ -198,6 +198,4 @@ public function to_array() { 'data' => $this->data, ); } - - } diff --git a/includes/admin/models/class-rop-post-format-model.php b/includes/admin/models/class-rop-post-format-model.php index ee910a2ff..12097db2b 100644 --- a/includes/admin/models/class-rop-post-format-model.php +++ b/includes/admin/models/class-rop-post-format-model.php @@ -115,7 +115,6 @@ public function add_update_post_format( $account_id, $data ) { $data = wp_parse_args( $data, $this->defaults ); $this->post_format[ $account_id ] = $data; $this->set( 'post_format', $this->post_format ); - } /** @@ -133,5 +132,4 @@ public function remove_post_format( $account_id ) { $this->set( 'post_format', $this->post_format ); } - } diff --git a/includes/admin/models/class-rop-posts-selector-model.php b/includes/admin/models/class-rop-posts-selector-model.php index 95a6b976e..ca93dcb63 100644 --- a/includes/admin/models/class-rop-posts-selector-model.php +++ b/includes/admin/models/class-rop-posts-selector-model.php @@ -102,7 +102,7 @@ public function get_taxonomies( $data = array() ) { if ( ( function_exists( 'icl_object_id' ) || class_exists( 'TRP_Translate_Press' ) ) && empty( $language_code ) ) { // check the first active account and it's post format and see if it has a language code. $first_account_id = array_keys( $this->data['active_accounts'] )[0]; - $post_format_model = new Rop_Post_Format_Model; + $post_format_model = new Rop_Post_Format_Model(); $post_format = $post_format_model->get_post_format( $first_account_id ); $first_account_lang = ! empty( $post_format['wpml_language'] ) ? $post_format['wpml_language'] : ''; @@ -220,7 +220,12 @@ public function get_posts( $selected_post_types, $taxonomies, $exclude, $search $args['post__in'] = $excluded; } else { $post_types = $this->build_post_types( $selected_post_types ); - $tax_queries = $this->build_tax_query( array( 'taxonomies' => $taxonomies, 'exclude' => $exclude ) ); + $tax_queries = $this->build_tax_query( + array( + 'taxonomies' => $taxonomies, + 'exclude' => $exclude, + ) + ); $args['post_type'] = $post_types; $args['tax_query'] = $tax_queries; } @@ -388,7 +393,7 @@ public function select( $account_id = false ) { } elseif ( empty( $results ) && $this->has_buffer_items( $account_id ) && ! $this->settings->get_more_than_once() ) { - $service = new Rop_Services_Model; + $service = new Rop_Services_Model(); $log = new Rop_Logger(); $accounts = get_option( 'rop_one_time_share_accounts' ); @@ -469,7 +474,7 @@ private function query_results( $account_id, $post_types, $tax_queries, $exclude */ $posts = array_diff( $posts, $exclude ); - $number_of_posts_to_share = ( new Rop_Settings_Model )->get_number_of_posts(); + $number_of_posts_to_share = ( new Rop_Settings_Model() )->get_number_of_posts(); $events_per_account = Rop_Scheduler_Model::EVENTS_PER_ACCOUNT; /** @@ -578,11 +583,11 @@ private function build_query_args( $post_types, $tax_queries, $exclude ) { } $min_age = $this->settings->get_minimum_post_age(); if ( ! empty( $min_age ) ) { - $args['date_query'][]['before'] = date( 'Y-m-d', strtotime( '-' . $this->settings->get_minimum_post_age() . ' days' ) ); + $args['date_query'][]['before'] = gmdate( 'Y-m-d', strtotime( '-' . $this->settings->get_minimum_post_age() . ' days' ) ); } $max_age = $this->settings->get_maximum_post_age(); if ( ! empty( $max_age ) ) { - $args['date_query'][]['after'] = date( 'Y-m-d', strtotime( '-' . $this->settings->get_maximum_post_age() . ' days' ) ); + $args['date_query'][]['after'] = gmdate( 'Y-m-d', strtotime( '-' . $this->settings->get_maximum_post_age() . ' days' ) ); } if ( ! empty( $args['date_query'] ) ) { $args['date_query']['relation'] = 'AND'; @@ -640,7 +645,6 @@ public function buffer_has_post_id( $account_id, $post_id ) { } return false; - } /** @@ -820,7 +824,6 @@ public function rop_wpml_id( $post_id, $account_id = '' ) { // Return original passed in post id if none of the conditions are met. return $post_id; } - } /** diff --git a/includes/admin/models/class-rop-queue-model.php b/includes/admin/models/class-rop-queue-model.php index ab7f32c28..1cde1cac1 100644 --- a/includes/admin/models/class-rop-queue-model.php +++ b/includes/admin/models/class-rop-queue-model.php @@ -180,7 +180,6 @@ public function ban_post( $post_id, $account_id ) { $this->update_queue( $queue ); return true; - } /** @@ -259,7 +258,7 @@ public function get_queue() { unset( $post_pool[ $rand_key ] ); $post_pool = array_values( $post_pool ); - $i++; + ++$i; } @@ -382,7 +381,7 @@ public function build_queue_publish_now() { 'custom_instant_share_message' => $custom_instant_share_message, ); } - $index ++; + ++$index; } return $normalized_queue; @@ -480,6 +479,4 @@ public function skip_post( $post_id, $account_id ) { return true; } - - } diff --git a/includes/admin/models/class-rop-scheduler-model.php b/includes/admin/models/class-rop-scheduler-model.php index e138d5807..94ffb52fc 100644 --- a/includes/admin/models/class-rop-scheduler-model.php +++ b/includes/admin/models/class-rop-scheduler-model.php @@ -149,14 +149,14 @@ public function create_schedule( $schedule_data = array() ) { * * @param int $timestamp Timestamp to format. * - * @return int + * @return string */ public static function get_date( $timestamp = 0 ) { if ( empty( $timestamp ) ) { $timestamp = self::get_current_time(); } - return date( self::get_date_format(), $timestamp ); + return gmdate( self::get_date_format(), $timestamp ); } /** @@ -199,7 +199,6 @@ public function add_update_schedule( $account_id, $schedule_data = false ) { $this->set( 'schedules', $this->schedules ); // Refresh events when we change the schedule. $this->refresh_events( $account_id ); - } /** @@ -302,14 +301,13 @@ function ( $value ) use ( &$prev ) { $prev = $value; return true; - } ); $current_events[ $account_id ] = $events; $this->update_timeline( $current_events ); - $retry ++; + ++$retry; if ( empty( $events ) && 0 === $retry ) { $events = $this->get_upcoming_events( $account_id, $retry ); } @@ -350,7 +348,7 @@ public function generate_upcoming_events( $base = 0, $account_id = null, $limit */ if ( ( time() - $this->start_time ) < 15 ) { array_push( $list, self::get_current_time() + 20 ); - $limit --; + --$limit; } if ( $schedule['type'] === 'recurring' ) { @@ -359,7 +357,7 @@ public function generate_upcoming_events( $base = 0, $account_id = null, $limit */ $time = $this->convert_float_to_time( $schedule['interval_r'] ); $event_time = $base; - for ( $i = 0; $i < $limit; $i ++ ) { + for ( $i = 0; $i < $limit; $i++ ) { $event_time = $this->add_to_time( $event_time, $time['hours'], $time['minutes'] ); array_push( $list, $event_time ); } @@ -419,7 +417,7 @@ function ( $time ) { if ( $i === $limit ) { break; } - $i ++; + ++$i; array_push( $list, $event_time ); } @@ -526,7 +524,7 @@ private function get_week_start( $start = 0 ) { if ( empty( $start ) ) { $start = self::get_current_time(); } - $strtotime = date( 'o-\WW', $start ); + $strtotime = gmdate( 'o-\WW', $start ); $start = strtotime( $strtotime ); return intval( $start ); @@ -535,8 +533,8 @@ private function get_week_start( $start = 0 ) { /** * Update the events timeline. * - * @param $new_events $new_events New events timeline. - * @param string $account_id account id. + * @param array $new_events $new_events New events timeline. + * @param string $account_id account id. * * @return bool Success or not. */ @@ -595,6 +593,4 @@ public function remove_schedule( $account_id ) { return $this->set( 'schedules', $this->schedules ); } - - } diff --git a/includes/admin/models/class-rop-services-model.php b/includes/admin/models/class-rop-services-model.php index 0bb8a3f7f..9a1324466 100644 --- a/includes/admin/models/class-rop-services-model.php +++ b/includes/admin/models/class-rop-services-model.php @@ -125,7 +125,7 @@ public function facebook_exception_toast_remove( $accounts_list ) { if ( ! empty( $service_data['available_accounts'] ) ) { foreach ( $service_data['available_accounts'] as $account_key => $value ) { if ( true === filter_var( $value['active'], FILTER_VALIDATE_BOOLEAN ) ) { - $fb_valid_accounts ++; + ++$fb_valid_accounts; } } } @@ -472,14 +472,12 @@ public function remove_service_account( $account_id = '' ) { $this->update_authenticated_services( $services ); return true; - } /** * Utility method to find a service. */ public function find_service() { - } /** @@ -519,5 +517,4 @@ public function find_account( $account_id ) { return false; } - } diff --git a/includes/admin/models/class-rop-settings-model.php b/includes/admin/models/class-rop-settings-model.php index 91f58d90c..c3565526f 100644 --- a/includes/admin/models/class-rop-settings-model.php +++ b/includes/admin/models/class-rop-settings-model.php @@ -52,46 +52,46 @@ class Rop_Settings_Model extends Rop_Model_Abstract { * @var array $shorteners The class defaults for shorteners. */ private static $shorteners = array( - 'rviv.ly' => array( - 'id' => 'rviv.ly', - 'name' => 'rviv.ly', - 'active' => true, + 'rviv.ly' => array( + 'id' => 'rviv.ly', + 'name' => 'rviv.ly', + 'active' => true, 'is_free' => true, ), - 'bit.ly' => array( - 'id' => 'bit.ly', - 'name' => 'bit.ly', - 'active' => true, + 'bit.ly' => array( + 'id' => 'bit.ly', + 'name' => 'bit.ly', + 'active' => true, 'is_free' => false, ), - 'firebase' => array( - 'id' => 'firebase', - 'name' => 'google firebase', - 'active' => true, + 'firebase' => array( + 'id' => 'firebase', + 'name' => 'google firebase', + 'active' => true, 'is_free' => false, ), - 'ow.ly' => array( - 'id' => 'ow.ly', - 'name' => 'ow.ly', - 'active' => true, + 'ow.ly' => array( + 'id' => 'ow.ly', + 'name' => 'ow.ly', + 'active' => true, 'is_free' => false, ), - 'is.gd' => array( - 'id' => 'is.gd', - 'name' => 'is.gd', - 'active' => true, + 'is.gd' => array( + 'id' => 'is.gd', + 'name' => 'is.gd', + 'active' => true, 'is_free' => false, ), - 'rebrand.ly' => array( - 'id' => 'rebrand.ly', - 'name' => 'rebrand.ly', - 'active' => true, + 'rebrand.ly' => array( + 'id' => 'rebrand.ly', + 'name' => 'rebrand.ly', + 'active' => true, 'is_free' => false, ), 'wp_short_url' => array( - 'id' => 'wp_short_url', - 'name' => 'wp_short_url', - 'active' => true, + 'id' => 'wp_short_url', + 'name' => 'wp_short_url', + 'active' => true, 'is_free' => true, ), ); @@ -136,7 +136,6 @@ function ( $value ) { $value['value'] = intval( $value['value'] ); return $value; - }, $setting ); @@ -209,7 +208,10 @@ public function get_selected_post_types() { */ public function get_available_post_types() { - $args = array( 'public' => true, 'show_ui' => true ); + $args = array( + 'public' => true, + 'show_ui' => true, + ); $post_types = get_post_types( $args, 'objects' ); $post_types_array = array(); $selected = $this->get_selected_post_types(); @@ -606,5 +608,4 @@ public function get_instant_sharing_by_default() { public function get_update_post_published_date() { return isset( $this->settings['update_post_published_date'] ) ? $this->settings['update_post_published_date'] : false; } - } diff --git a/includes/admin/models/class-rop-shortners-model.php b/includes/admin/models/class-rop-shortners-model.php index 3be5a9378..ca45d4a06 100644 --- a/includes/admin/models/class-rop-shortners-model.php +++ b/includes/admin/models/class-rop-shortners-model.php @@ -44,7 +44,6 @@ public function __construct( $shortner, $default_credentials ) { $this->shortner_name = str_replace( '.', '', $shortner ); parent::__construct( 'rop_shortners_' . $this->shortner_name ); $this->credentials = ( $this->get( $this->shortner_name . '_credentials' ) != null ) ? $this->get( $this->shortner_name . '_credentials' ) : $default_credentials; - } /** diff --git a/includes/admin/notices/class-rop-admin-notices-helpers.php b/includes/admin/notices/class-rop-admin-notices-helpers.php index d1afb201a..72ddfe653 100644 --- a/includes/admin/notices/class-rop-admin-notices-helpers.php +++ b/includes/admin/notices/class-rop-admin-notices-helpers.php @@ -30,7 +30,7 @@ public static function rop_get_days_since_installed() { if ( ! empty( $installed_date ) ) { $installed_date = '@' . $installed_date; } else { - $installed_date = '@' . mktime( 0, 0, 0, date( 'm' ), date( 'd' ) - 2, date( 'Y' ) ); + $installed_date = '@' . mktime( 0, 0, 0, gmdate( 'm' ), gmdate( 'd' ) - 2, gmdate( 'Y' ) ); } $installed_date = new DateTime( $installed_date ); @@ -40,18 +40,18 @@ public static function rop_get_days_since_installed() { return (int) $days_since_installed; } - /** - * Check whether the user has dismissed an admin notice and add the option to the database if they did. - * - * @since 8.7.0 - */ + /** + * Check whether the user has dismissed an admin notice and add the option to the database if they did. + * + * @since 8.7.0 + */ public static function rop_notice_dismissed() { - if ( ! wp_verify_nonce( $_REQUEST['rop_notice_nonce'], 'rop_notice_nonce_value' ) ) { + if ( ! isset( $_REQUEST['rop_notice_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['rop_notice_nonce'] ) ), 'rop_notice_nonce_value' ) ) { exit( 'Failed to verify nonce. Please try going back and refreshing the page to try again.' ); } - $notice_id = ! empty( $_REQUEST['rop_notice_id'] ) ? $_REQUEST['rop_notice_id'] : ''; + $notice_id = ! empty( $_REQUEST['rop_notice_id'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['rop_notice_id'] ) ) : ''; if ( ! empty( $notice_id ) ) { @@ -59,24 +59,20 @@ public static function rop_notice_dismissed() { add_user_meta( $user_id, $notice_id, 'true', true ); - wp_redirect( $_SERVER['HTTP_REFERER'] ); - exit; - - } else { - - return; - + if ( isset( $_SERVER['HTTP_REFERER'] ) ) { + wp_safe_redirect( esc_url_raw( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) ); + exit; + } } - } - /** - * Check whether the user has dismissed an admin notice and add the option to the database if they did. - * - * @param int $user_id The user ID. - * @param string $notice_id unique notice ID. - * @since 8.7.0 - */ + /** + * Check whether the user has dismissed an admin notice and add the option to the database if they did. + * + * @param int $user_id The user ID. + * @param string $notice_id unique notice ID. + * @since 8.7.0 + */ public static function rop_should_show_notice( $user_id, $notice_id ) { $rop_user_dismissed_notice = get_user_meta( $user_id, $notice_id ); diff --git a/includes/admin/notices/class-rop-admin-notices.php b/includes/admin/notices/class-rop-admin-notices.php index 85e630457..490b8a6a9 100644 --- a/includes/admin/notices/class-rop-admin-notices.php +++ b/includes/admin/notices/class-rop-admin-notices.php @@ -23,9 +23,9 @@ public function rop_revive_network_nag_delayed() { $notice_id = 'rop_revive_network_nag'; $user_id = wp_get_current_user()->ID; - $days_since_installed = Rop_Admin_Notices_Helpers::rop_get_days_since_installed(); - $should_show_notice = Rop_Admin_Notices_Helpers::rop_should_show_notice( $user_id, $notice_id ); - $revive_network_active = class_exists( 'Revive_Network_Admin' ); + $days_since_installed = Rop_Admin_Notices_Helpers::rop_get_days_since_installed(); + $should_show_notice = Rop_Admin_Notices_Helpers::rop_should_show_notice( $user_id, $notice_id ); + $revive_network_active = class_exists( 'Revive_Network_Admin' ); if ( $days_since_installed >= 3 && $should_show_notice && $revive_network_active === false ) { @@ -52,10 +52,7 @@ public function rop_revive_network_nag_delayed() { UPSELLHTML; - echo $markup; + echo wp_kses_post( $markup ); } - } - - } diff --git a/includes/admin/services/class-rop-bluesky-service.php b/includes/admin/services/class-rop-bluesky-service.php index 21753724e..ce4c91d37 100644 --- a/includes/admin/services/class-rop-bluesky-service.php +++ b/includes/admin/services/class-rop-bluesky-service.php @@ -284,7 +284,7 @@ public function add_account_with_app( $data ) { 'account' => $user->handle, 'service' => $this->service_name, 'img' => $user->avatar ? $user->avatar : '', - 'created' => date( 'd/m/Y H:i' ), + 'created' => gmdate( 'd/m/Y H:i' ), 'active' => $active, ), ), diff --git a/includes/admin/services/class-rop-facebook-service.php b/includes/admin/services/class-rop-facebook-service.php index 3c506a5a5..ea92d96df 100644 --- a/includes/admin/services/class-rop-facebook-service.php +++ b/includes/admin/services/class-rop-facebook-service.php @@ -93,7 +93,7 @@ public function authorize() { return false; } - $credentials = $_SESSION['rop_facebook_credentials']; + $credentials = isset( $_SESSION['rop_facebook_credentials'] ) ? $_SESSION['rop_facebook_credentials'] : array(); try { $api = $this->get_api( $credentials['app_id'], $credentials['secret'] ); @@ -195,7 +195,7 @@ public function maybe_authenticate() { return false; } - if ( ! $this->is_set_not_empty( + if ( ! isset( $_SESSION['rop_facebook_credentials'] ) || ! $this->is_set_not_empty( $_SESSION['rop_facebook_credentials'], array( 'app_id', @@ -204,15 +204,14 @@ public function maybe_authenticate() { ) ) { return false; } - $credentials = $_SESSION['rop_facebook_credentials']; - $token = $_SESSION['rop_facebook_token']; + $credentials = isset( $_SESSION['rop_facebook_credentials'] ) ? $_SESSION['rop_facebook_credentials'] : array(); + $token = isset( $_SESSION['rop_facebook_token'] ) ? $_SESSION['rop_facebook_token'] : ''; $credentials['token'] = $token; unset( $_SESSION['rop_facebook_credentials'] ); unset( $_SESSION['rop_facebook_token'] ); return $this->authenticate( $credentials ); - } /** @@ -303,7 +302,6 @@ public function authenticate( $args = array() ) { ); return true; - } /** @@ -462,7 +460,7 @@ public function share( $post_details, $args = array() ) { return false; } - $model = new Rop_Post_Format_Model; + $model = new Rop_Post_Format_Model(); $post_format = $model->get_post_format( $post_details['account_id'] ); $hashtags = $post_details['hashtags']; @@ -575,7 +573,6 @@ public function share( $post_details, $args = array() ) { } else { return false; } - } /** @@ -636,7 +633,6 @@ private function fb_image_post( $post_details, $hashtags ) { 'post_data' => $new_post, 'type' => 'photo', ); - } /** @@ -686,7 +682,6 @@ private function fb_text_post( $post_details, $hashtags ) { 'post_data' => $new_post, 'type' => 'post', ); - } /** @@ -1059,8 +1054,9 @@ public function add_account_with_app( $account_data ) { $accounts = array(); $pages_arr = $account_data['pages']; + $pages_count = count( $pages_arr ); - for ( $i = 0; $i < sizeof( $pages_arr ); $i ++ ) { + for ( $i = 0; $i < $pages_count; $i++ ) { $page_data = unserialize( base64_decode( $pages_arr[ $i ] ) ); // assign default values to variable @@ -1149,7 +1145,6 @@ public function rop_fb_scrape_url( $posting_type, $post_id, $token ) { $this->logger->info( 'Scrape Info: ' . $body ); } - } /** @@ -1172,5 +1167,4 @@ public function populate_additional_data( $account ) { } return $account; } - } diff --git a/includes/admin/services/class-rop-gmb-service.php b/includes/admin/services/class-rop-gmb-service.php index 64cf12e63..127db0f77 100644 --- a/includes/admin/services/class-rop-gmb-service.php +++ b/includes/admin/services/class-rop-gmb-service.php @@ -168,8 +168,9 @@ public function add_account_with_app( $accounts_data ) { $accounts_array = unserialize( base64_decode( $accounts_data['pages'] ) ); $accounts = array(); + $accounts_count = count( $accounts_array ); - for ( $i = 0; $i < sizeof( $accounts_array ); $i++ ) { + for ( $i = 0; $i < $accounts_count; $i++ ) { $account = $this->user_default; @@ -194,10 +195,10 @@ public function add_account_with_app( $accounts_data ) { 'id' => $the_id, 'service' => $this->service_name, 'credentials' => array( - 'created' => $account_data['created'], - 'expires_in' => $account_data['expires_in'], - 'access_token' => $account_data['access_token'], - 'refresh_token' => $account_data['refresh_token'], + 'created' => $account_data['created'], + 'expires_in' => $account_data['expires_in'], + 'access_token' => $account_data['access_token'], + 'refresh_token' => $account_data['refresh_token'], ), 'available_accounts' => $accounts, ); @@ -237,14 +238,17 @@ private function gmb_refresh_access_token() { } } - // $created = '1593273390'; + // $created = '1593273390'; // Check if access token will expire in next 30 seconds. $expired = ( $created + ( $expires_in - 30 ) ) < time(); // If it's not expired then return current access token in DB if ( ! $expired ) { // Add an expires_in value to prevent Google Client PHP notice for undefined expires_in index - $access_token = array('access_token' => $access_token, 'expires_in' => $expires_in); + $access_token = array( + 'access_token' => $access_token, + 'expires_in' => $expires_in, + ); return $access_token; } @@ -270,11 +274,11 @@ private function gmb_refresh_access_token() { $update_token = array( 'services' => array( $gmb_service_id => array( - 'id' => $id, - 'service' => 'gmb', + 'id' => $id, + 'service' => 'gmb', 'credentials' => array( - 'created' => $response['token_data']['created'], - 'expires_in' => $response['token_data']['expires_in'], + 'created' => $response['token_data']['created'], + 'expires_in' => $response['token_data']['expires_in'], 'access_token' => $response['token_data']['access_token'], ), ), @@ -287,7 +291,6 @@ private function gmb_refresh_access_token() { update_option( 'rop_data', $rop_updated_data ); return $response['token_data']; - } /** @@ -340,7 +343,6 @@ private function gmb_image_post( $post_details, $args, $new_post ) { $new_post->setMedia( $media ); return $new_post; - } @@ -365,7 +367,6 @@ private function gmb_text_post( $post_details, $args, $new_post ) { $new_post->setSummary( $post_details['content'] ); return $new_post; - } /** @@ -414,7 +415,6 @@ private function gmb_article_post( $post_details, $args, $new_post ) { $new_post->setMedia( $media ); return $new_post; - } @@ -449,7 +449,6 @@ private function gmb_link_with_no_image_post( $post_details, $args, $new_post ) $new_post->setCallToAction( $call_to_action ); return $new_post; - } /** * Method for publishing with Google My Business service. @@ -478,7 +477,7 @@ public function share( $post_details, $args = array() ) { if ( ! class_exists( 'Google_Service_MyBusiness' ) ) { - include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); + include_once ABSPATH . 'wp-admin/includes/plugin.php'; if ( is_plugin_active( 'tweet-old-post-pro/tweet-old-post-pro.php' ) ) { require_once ROP_PRO_PATH . 'lib/gmb/gmb-service-helper.php'; @@ -544,7 +543,6 @@ public function share( $post_details, $args = array() ) { $this->logger->alert_error( Rop_I18n::get_labels( 'errors.gmb_failed_share' ) . print_r( $response, true ) ); return false; } - } /** @@ -558,5 +556,4 @@ public function populate_additional_data( $account ) { $account['link'] = 'https://business.google.com/'; return $account; } - } diff --git a/includes/admin/services/class-rop-linkedin-service.php b/includes/admin/services/class-rop-linkedin-service.php index bca351ba5..5a481d90e 100644 --- a/includes/admin/services/class-rop-linkedin-service.php +++ b/includes/admin/services/class-rop-linkedin-service.php @@ -124,9 +124,10 @@ public function authorize() { $this->logger->alert_error( $message ); $this->rop_get_error_docs( $message ); } - exit( wp_redirect( $this->get_legacy_url() ) ); + wp_safe_redirect( esc_url_raw( $this->get_legacy_url() ) ); + exit; } else { - $credentials = $_SESSION['rop_linkedin_credentials']; + $credentials = isset( $_SESSION['rop_linkedin_credentials'] ) ? $_SESSION['rop_linkedin_credentials'] : array(); $api = $this->get_api( $credentials['client_id'], $credentials['secret'] ); $accessToken = $api->getAccessToken( $_GET['code'] ); $_SESSION['rop_linkedin_token'] = $accessToken->getToken(); @@ -138,10 +139,11 @@ public function authorize() { $message = 'Linkedin Error: Code[ ' . $e->getCode() . ' ] ' . $e->getDescription(); $this->logger->alert_error( $message ); $this->rop_get_error_docs( $message ); - $referrer = $_SERVER['HTTP_REFERER']; + $referrer = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : ''; // If the user is trying to authenticate. if ( ! empty( substr_count( $referrer, 'linkedin.com' ) ) ) { - exit( wp_redirect( $this->get_legacy_url() ) ); + wp_redirect( esc_url_raw( $this->get_legacy_url() ) ); + exit; } else { // If the function is used by the Cron and this error occurs. $this->error->throw_exception( 'Error ' . $e->getCode(), $message ); @@ -213,7 +215,7 @@ public function maybe_authenticate() { return false; } if ( ! $this->is_set_not_empty( - $_SESSION['rop_linkedin_credentials'], + isset( $_SESSION['rop_linkedin_credentials'] ) ? $_SESSION['rop_linkedin_credentials'] : array(), array( 'client_id', 'secret', @@ -222,8 +224,9 @@ public function maybe_authenticate() { return false; } - $credentials = $_SESSION['rop_linkedin_credentials']; - $token = $_SESSION['rop_linkedin_token']; + $credentials = isset( $_SESSION['rop_linkedin_credentials'] ) ? $_SESSION['rop_linkedin_credentials'] : array(); + $token = isset( $_SESSION['rop_linkedin_token'] ) ? $_SESSION['rop_linkedin_token'] : ''; + $credentials['token'] = $token; unset( $_SESSION['rop_linkedin_credentials'] ); @@ -301,7 +304,6 @@ public function authenticate( $args ) { ); return true; - } /** @@ -530,7 +532,7 @@ public function share( $post_details, $args = array() ) { $share_as_image_post = $post_details['post_with_image']; $post_id = $post_details['post_id']; - $model = new Rop_Post_Format_Model; + $model = new Rop_Post_Format_Model(); $post_format = $model->get_post_format( $post_details['account_id'] ); if ( ! empty( $post_format['share_link_in_comment'] ) && ! empty( $post_format['share_link_text'] ) ) { @@ -650,7 +652,6 @@ public function share( $post_details, $args = array() ) { $this->rop_refresh_linkedin_token_notice(); return false; } - } @@ -709,7 +710,6 @@ function ( $matches ) { } return $new_post; - } /** @@ -758,7 +758,6 @@ function ( $matches ) { ); return $new_post; - } /** @@ -850,7 +849,7 @@ public function add_account_with_app( $accounts_data ) { // save timestamp for when to notify user to refresh their linkedin token // set notified count to 0 $notify_data = array( - 'notify_at' => $notify_user_at['notify_user_at'], + 'notify_at' => $notify_user_at['notify_user_at'], 'notified_count' => 0, ); @@ -858,7 +857,9 @@ public function add_account_with_app( $accounts_data ) { $accounts = array(); - for ( $i = 0; $i < sizeof( $accounts_array ); $i ++ ) { + $accounts_count = count( $accounts_array ); + + for ( $i = 0; $i < $accounts_count; $i++ ) { $account = $this->user_default; @@ -927,7 +928,7 @@ public function rop_refresh_linkedin_token_notice() { // Backwards compatibility pre v8.6.4 if ( ! is_array( $notify ) ) { $notify = array( - 'notify_at' => $notify, + 'notify_at' => $notify, 'notified_count' => 0, ); } @@ -954,9 +955,9 @@ public function rop_refresh_linkedin_token_notice() { $sent = wp_mail( $admin_email, $subject, $message, $headers ); if ( $sent ) { - $notified_count++; + ++$notified_count; $notify_data = array( - 'notify_at' => $notify_at, + 'notify_at' => $notify_at, 'notified_count' => $notified_count, ); update_option( 'rop_linkedin_refresh_token_notice', $notify_data, false ); @@ -965,7 +966,6 @@ public function rop_refresh_linkedin_token_notice() { $this->logger->alert_error( Rop_I18n::get_labels( 'general.rop_linkedin_refresh_token' ) ); } - } /** @@ -1092,5 +1092,4 @@ public function rop_is_business_plan() { return false; } - } diff --git a/includes/admin/services/class-rop-mastodon-service.php b/includes/admin/services/class-rop-mastodon-service.php index 16477c5e4..d5161dee4 100644 --- a/includes/admin/services/class-rop-mastodon-service.php +++ b/includes/admin/services/class-rop-mastodon-service.php @@ -114,11 +114,16 @@ public function authorize() { return false; } - $request_token = $_SESSION['rop_mastodon_credentials']; - // phpcs:ignore - $code = sanitize_text_field( isset( $_GET['code'] ) ? $_GET['code'] : '' ); + // Safely read session data and GET param. + $request_token = isset( $_SESSION['rop_mastodon_credentials'] ) && is_array( $_SESSION['rop_mastodon_credentials'] ) ? $_SESSION['rop_mastodon_credentials'] : array(); + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $code = isset( $_GET['code'] ) ? sanitize_text_field( wp_unslash( $_GET['code'] ) ) : ''; - $access_token = $this->request_api_access_token( $code, $request_token['md_domain'], $request_token['consumer_key'], $request_token['consumer_secret'] ); + $md_domain = isset( $request_token['md_domain'] ) ? $request_token['md_domain'] : ''; + $consumer_key = isset( $request_token['consumer_key'] ) ? $request_token['consumer_key'] : ''; + $consumer_secret = isset( $request_token['consumer_secret'] ) ? $request_token['consumer_secret'] : ''; + + $access_token = $this->request_api_access_token( $code, $md_domain, $consumer_key, $consumer_secret ); if ( ! empty( $access_token ) ) { $_SESSION['rop_mastodon_oauth_token'] = $access_token; } @@ -174,10 +179,14 @@ public function maybe_authenticate() { ) ) { return false; } - $token = $_SESSION['rop_mastodon_oauth_token']; - $consumer_key = $_SESSION['rop_mastodon_credentials']['consumer_key']; - $consumer_secret = $_SESSION['rop_mastodon_credentials']['consumer_secret']; - $domain = $_SESSION['rop_mastodon_credentials']['md_domain']; + // Safely read session data. + $token = isset( $_SESSION['rop_mastodon_oauth_token'] ) ? $_SESSION['rop_mastodon_oauth_token'] : ''; + $creds = isset( $_SESSION['rop_mastodon_credentials'] ) && is_array( $_SESSION['rop_mastodon_credentials'] ) ? $_SESSION['rop_mastodon_credentials'] : array(); + + $consumer_key = isset( $creds['consumer_key'] ) ? $creds['consumer_key'] : ''; + $consumer_secret = isset( $creds['consumer_secret'] ) ? $creds['consumer_secret'] : ''; + $domain = isset( $creds['md_domain'] ) ? $creds['md_domain'] : ''; + unset( $_SESSION['rop_mastodon_oauth_token'] ); unset( $_SESSION['rop_mastodon_request_token'] ); unset( $_SESSION['rop_mastodon_credentials'] ); @@ -238,7 +247,7 @@ public function authenticate( $args = array() ) { 'service' => $this->service_name, 'credentials' => $this->credentials, 'public_credentials' => array( - 'mastodon' => array( + 'mastodon' => array( 'name' => 'Mastodon', 'value' => $this->domain, 'private' => false, @@ -417,7 +426,7 @@ public function request_api_token() { $response = wp_remote_post( $api_url, array( - 'body' => array( + 'body' => array( 'client_name' => 'Revive Social', 'redirect_uris' => $this->get_legacy_url(), 'scopes' => $this->scopes, @@ -917,7 +926,7 @@ public function add_account_with_app( $account_data ) { 'service' => $this->service_name, 'credentials' => $this->credentials, 'public_credentials' => array( - 'mastodon' => array( + 'mastodon' => array( 'name' => 'Mastodon', 'value' => $this->domain, 'private' => false, diff --git a/includes/admin/services/class-rop-pinterest-service.php b/includes/admin/services/class-rop-pinterest-service.php index beaca2c6e..23f70ac70 100644 --- a/includes/admin/services/class-rop-pinterest-service.php +++ b/includes/admin/services/class-rop-pinterest-service.php @@ -97,9 +97,10 @@ public function authorize() { $this->request_api_token(); parent::authorize(); } catch ( Exception $e ) { - $message = 'Pinterest Error: Code[ ' . $e->getCode() . ' ] ' . $e->getMessage(); + $message = 'Pinterest Error: Code[ ' . esc_html( $e->getCode() ) . ' ] ' . esc_html( $e->getMessage() ); $this->logger->alert_error( $message ); - exit( wp_redirect( $this->get_legacy_url() ) ); + wp_redirect( esc_url_raw( $this->get_legacy_url() ) ); + exit; } // echo ''; } @@ -117,6 +118,9 @@ public function request_api_token() { if ( ! session_id() ) { session_start(); } + if ( ! isset( $_SESSION['rop_pinterest_credentials'] ) ) { + return false; + } $credentials = $_SESSION['rop_pinterest_credentials']; $api = $this->get_api( $credentials['app_id'], $credentials['secret'] ); @@ -124,7 +128,7 @@ public function request_api_token() { $token = $api->auth->getOAuthToken( trim( $_GET['code'] ) ); if ( ! isset( $token->access_token ) ) { - throw new Exception( $this->display_name . ' could not get Oauth Token' ); + throw new Exception( esc_html( $this->display_name ) . ' could not get Oauth Token' ); } $api->auth->setOAuthToken( $token->access_token ); @@ -197,7 +201,7 @@ public function maybe_authenticate() { return false; } - if ( ! $this->is_set_not_empty( + if ( ! isset( $_SESSION['rop_pinterest_credentials'] ) || ! $this->is_set_not_empty( $_SESSION['rop_pinterest_credentials'], array( 'app_id', @@ -207,13 +211,15 @@ public function maybe_authenticate() { return false; } $credentials = $_SESSION['rop_pinterest_credentials']; + if ( ! isset( $_SESSION['rop_pinterest_token'] ) ) { + return false; + } $token = $_SESSION['rop_pinterest_token']; $credentials['token'] = $token; unset( $_SESSION['rop_pinterest_credentials'] ); unset( $_SESSION['rop_pinterest_token'] ); return $this->authenticate( $credentials ); - } /** @@ -276,7 +282,6 @@ public function authenticate( $args = array() ) { ); return true; - } /** @@ -470,7 +475,7 @@ public function share( $post_details, $args = array() ) { * * @return bool|string */ - function this_image_realpath_to_uploads( $image_id = 0, $requested_size = 'large' ) { + public function this_image_realpath_to_uploads( $image_id = 0, $requested_size = 'large' ) { if ( empty( $image_id ) ) { return false; } @@ -559,5 +564,4 @@ public function populate_additional_data( $account ) { $account['link'] = 'https://pinterest.com'; return $account; } - } diff --git a/includes/admin/services/class-rop-telegram-service.php b/includes/admin/services/class-rop-telegram-service.php index 1e386ee34..ed1d95a79 100644 --- a/includes/admin/services/class-rop-telegram-service.php +++ b/includes/admin/services/class-rop-telegram-service.php @@ -195,7 +195,7 @@ public function add_account_with_app( $data ) { 'account' => $account, 'service' => $this->service_name, 'img' => apply_filters( 'rop_custom_telegram_avatar', $telegram->get_profile_photo( $id ) ), - 'created' => date( 'd/m/Y H:i' ), + 'created' => gmdate( 'd/m/Y H:i' ), 'active' => isset( $data['active'] ) ? $data['active'] : true, ), ), @@ -265,7 +265,6 @@ private function tlg_text_post( $post_details, $hashtags, $args, $chat_id ) { ); return $new_post; - } /** @@ -389,5 +388,4 @@ public function share( $post_details, $args = array() ) { public function populate_additional_data( $account ) { return $account; } - } diff --git a/includes/admin/services/class-rop-tumblr-service.php b/includes/admin/services/class-rop-tumblr-service.php index 4f10ce860..f2b64191d 100644 --- a/includes/admin/services/class-rop-tumblr-service.php +++ b/includes/admin/services/class-rop-tumblr-service.php @@ -79,8 +79,8 @@ public function authorize() { return false; } - $credentials = $_SESSION['rop_tumblr_credentials']; - $tmp_token = $_SESSION['rop_tumblr_request_token']; + $credentials = isset( $_SESSION['rop_tumblr_credentials'] ) ? $_SESSION['rop_tumblr_credentials'] : array(); + $tmp_token = isset( $_SESSION['rop_tumblr_request_token'] ) ? $_SESSION['rop_tumblr_request_token'] : array(); $api = $this->get_api( $credentials['consumer_key'], $credentials['consumer_secret'], $tmp_token['oauth_token'], $tmp_token['oauth_token_secret'] ); $requestHandler = $api->getRequestHandler(); @@ -150,7 +150,6 @@ public function set_api( $consumer_key = '', $consumer_secret = '', $token = nul return false; } $this->api = new \Tumblr\API\Client( $this->strip_whitespace( $consumer_key ), $this->strip_whitespace( $consumer_secret ), $this->strip_whitespace( $token ), $this->strip_whitespace( $token_secret ) ); - } /** @@ -178,7 +177,7 @@ public function maybe_authenticate() { return false; } if ( ! $this->is_set_not_empty( - $_SESSION['rop_tumblr_token'], + isset( $_SESSION['rop_tumblr_token'] ) ? $_SESSION['rop_tumblr_token'] : array(), array( 'oauth_token', 'oauth_token_secret', @@ -187,9 +186,9 @@ public function maybe_authenticate() { ) { return false; } - $credentials = $_SESSION['rop_tumblr_credentials']; - $credentials['oauth_token'] = $_SESSION['rop_tumblr_token']['oauth_token']; - $credentials['oauth_token_secret'] = $_SESSION['rop_tumblr_token']['oauth_token_secret']; + $credentials = isset( $_SESSION['rop_tumblr_credentials'] ) ? $_SESSION['rop_tumblr_credentials'] : array(); + $credentials['oauth_token'] = isset( $_SESSION['rop_tumblr_token']['oauth_token'] ) ? $_SESSION['rop_tumblr_token']['oauth_token'] : ''; + $credentials['oauth_token_secret'] = isset( $_SESSION['rop_tumblr_token']['oauth_token_secret'] ) ? $_SESSION['rop_tumblr_token']['oauth_token_secret'] : ''; unset( $_SESSION['rop_tumblr_credentials'] ); unset( $_SESSION['rop_tumblr_token'] ); @@ -597,7 +596,6 @@ public function share( $post_details, $args = array() ) { return false; } - } /** @@ -715,5 +713,4 @@ public function populate_additional_data( $account ) { $account['link'] = sprintf( 'https://tumblr.com/blog/%s', $account['id'] ); return $account; } - } diff --git a/includes/admin/services/class-rop-twitter-service.php b/includes/admin/services/class-rop-twitter-service.php index 3647c9822..71259d66c 100644 --- a/includes/admin/services/class-rop-twitter-service.php +++ b/includes/admin/services/class-rop-twitter-service.php @@ -101,10 +101,17 @@ public function authorize() { return false; } + if ( ! isset( $_SESSION['rop_twitter_request_token'] ) ) { + return false; + } $request_token = $_SESSION['rop_twitter_request_token']; $api = $this->get_api( $request_token['oauth_token'], $request_token['oauth_token_secret'] ); + if ( ! isset( $_GET['oauth_verifier'] ) ) { + return false; + } + $access_token = $api->oauth( 'oauth/access_token', array( @@ -163,7 +170,6 @@ public function set_api( $oauth_token = '', $oauth_token_secret = '', $consumer_ } $this->api = new \Abraham\TwitterOAuth\TwitterOAuth( $this->strip_whitespace( $consumer_key ), $this->strip_whitespace( $consumer_secret ), $this->strip_whitespace( $oauth_token ), $this->strip_whitespace( $oauth_token_secret ) ); - } /** @@ -184,6 +190,13 @@ public function maybe_authenticate() { ) ) { return false; } + if ( + ! isset( $_SESSION['rop_twitter_oauth_token'] ) || + ! isset( $_SESSION['rop_twitter_credentials']['consumer_key'] ) || + ! isset( $_SESSION['rop_twitter_credentials']['consumer_secret'] ) + ) { + return false; + } $token = $_SESSION['rop_twitter_oauth_token']; $token['consumer_key'] = $_SESSION['rop_twitter_credentials']['consumer_key']; $token['consumer_secret'] = $_SESSION['rop_twitter_credentials']['consumer_secret']; @@ -258,7 +271,6 @@ public function authenticate( $args = array() ) { ); return true; - } /** @@ -547,7 +559,7 @@ private function twitter_media_post( $post_details, $api ) { $media_id = $media_response->data->id; $this->logger->info( 'State : ' . json_encode( $upload_status ) ); sleep( 3 ); - $limit ++; + ++$limit; } while ( $upload_status->processing_info->state !== 'succeeded' && $limit <= 10 ); if ( ! empty( $media_id ) ) { @@ -609,7 +621,7 @@ public function share( $post_details, $args = array() ) { $api = $this->get_api(); } - $model = new Rop_Post_Format_Model; + $model = new Rop_Post_Format_Model(); $post_format = $model->get_post_format( $post_details['account_id'] ); $post_id = $post_details['post_id']; @@ -631,7 +643,7 @@ public function share( $post_details, $args = array() ) { } // Twitter media post - if ( isset( $api ) && ! empty( $share_as_image_post ) || get_post_type( $post_id ) === 'attachment' ) { + if ( ( isset( $api ) && ! empty( $share_as_image_post ) ) || get_post_type( $post_id ) === 'attachment' ) { $new_post = $this->twitter_media_post( $post_details, $api ); } elseif ( ! isset( $api ) && ! empty( $share_as_image_post ) ) { $this->logger->info( __( 'Post with image is available only the local mode (Use my own API Keys). You can find the option when adding your X account to the plugin Dashboard.', 'tweet-old-post' ) . ' ' . __( ' Read more on:', 'tweet-old-post' ) . 'https://docs.revive.social/article/1908-how-to-solve-453-twitter-error-in-rop' ); @@ -713,7 +725,8 @@ public function share( $post_details, $args = array() ) { $time_diff = max( $time_diff, $reset - time() ); $max_reset = max( $max_reset, $reset ); - $reset_time_msg .= '(' . __( '"x-rate-limit-remaining" will reset at:', 'tweet-old-post' ) . ' ' . date( 'Y-m-d H:i:s', $reset ) . ' UTC' . ')'; + + $reset_time_msg .= '(' . __( '"x-rate-limit-remaining" will reset at:', 'tweet-old-post' ) . ' ' . gmdate( 'Y-m-d H:i:s', $reset ) . ' UTC)'; } } @@ -724,7 +737,7 @@ public function share( $post_details, $args = array() ) { $time_diff = max( $time_diff, $reset - time() ); $max_reset = max( $max_reset, $reset ); - $reset_time_msg .= '(' . __( '"x-user-limit-24hour-remaining" will reset at:', 'tweet-old-post' ) . ' ' . date( 'Y-m-d H:i:s', $reset ) . ' UTC' . ')'; + $reset_time_msg .= '(' . __( '"x-user-limit-24hour-remaining" will reset at:', 'tweet-old-post' ) . ' ' . gmdate( 'Y-m-d H:i:s', $reset ) . ' UTC)'; } } @@ -735,12 +748,12 @@ public function share( $post_details, $args = array() ) { $time_diff = max( $time_diff, $reset - time() ); $max_reset = max( $max_reset, $reset ); - $reset_time_msg .= '(' . __( '"x-app-limit-24hour-remaining" will reset at:', 'tweet-old-post' ) . ' ' . date( 'Y-m-d H:i:s', $reset ) . ' UTC' . ')'; + $reset_time_msg .= '(' . __( '"x-app-limit-24hour-remaining" will reset at:', 'tweet-old-post' ) . ' ' . gmdate( 'Y-m-d H:i:s', $reset ) . ' UTC)'; } } if ( 0 < $time_diff ) { - set_transient( $transient_key, $log_limit_msg . __( 'All limits will be fully reset by', 'tweet-old-post' ) . ': ' . date( 'Y-m-d H:i:s', $max_reset ) . ' ' . $reset_time_msg, $time_diff ); + set_transient( $transient_key, $log_limit_msg . __( 'All limits will be fully reset by', 'tweet-old-post' ) . ': ' . gmdate( 'Y-m-d H:i:s', $max_reset ) . ' ' . $reset_time_msg, $time_diff ); } if ( isset( $response['data'] ) && ! empty( $response['data']['id'] ) ) { @@ -962,11 +975,11 @@ public static function rop_share_post_via_server( $sharing_type = 'tw', $post_da 'timeout' => 100, 'body' => array_merge( array( - 'sharing_type' => $sharing_type, - 'license' => $license_key, - 'plan_id' => $plan_id, - 'site_url' => get_site_url(), - 'post_data' => $post_data, + 'sharing_type' => $sharing_type, + 'license' => $license_key, + 'plan_id' => $plan_id, + 'site_url' => get_site_url(), + 'post_data' => $post_data, 'rop_auth_token' => $rop_auth_token, ) ), diff --git a/includes/admin/services/class-rop-vk-service.php b/includes/admin/services/class-rop-vk-service.php index 9e009a3c1..580fdbb27 100644 --- a/includes/admin/services/class-rop-vk-service.php +++ b/includes/admin/services/class-rop-vk-service.php @@ -15,7 +15,7 @@ * @subpackage Rop/includes/admin/services */ -use \VK\Client\VKApiClient; +use VK\Client\VKApiClient; /** * Class Rop_Vk_Service * @@ -169,8 +169,9 @@ public function add_account_with_app( $accounts_data ) { $accounts_array = unserialize( base64_decode( $accounts_data['pages'] ) ); $accounts = array(); + $accounts_count = count( $accounts_array ); - for ( $i = 0; $i < sizeof( $accounts_array ); $i++ ) { + for ( $i = 0; $i < $accounts_count; $i++ ) { $account = $this->user_default; @@ -196,7 +197,7 @@ public function add_account_with_app( $accounts_data ) { 'id' => $the_id, 'service' => $this->service_name, 'credentials' => array( - 'access_token' => $account_data['access_token'], + 'access_token' => $account_data['access_token'], ), 'available_accounts' => $accounts, ); @@ -288,9 +289,9 @@ private function vk_media_post( $post_details, $hashtags, $args, $owner_id, $cli } $params = array( - 'photo' => stripslashes( $response['photo'] ), + 'photo' => stripslashes( $response['photo'] ), 'server' => (int) $response['server'], - 'hash' => (string) $response['hash'], + 'hash' => (string) $response['hash'], ); if ( $args['is_company'] ) { @@ -307,12 +308,11 @@ private function vk_media_post( $post_details, $hashtags, $args, $owner_id, $cli $attachment = 'photo' . $response[0]['owner_id'] . '_' . $response[0]['id']; $new_post = array( - 'owner_id' => $owner_id, - 'message' => $post_details['content'] . $hashtags, + 'owner_id' => $owner_id, + 'message' => $post_details['content'] . $hashtags, 'attachments' => empty( $this->share_link_text ) ? $attachment . ',' . $this->get_url( $post_details ) : $attachment, ); return $new_post; - } /** @@ -334,7 +334,7 @@ private function vk_media_post( $post_details, $hashtags, $args, $owner_id, $cli private function vk_video_post( $post_details, $hashtags, $attachment_path, $args, $owner_id, $client, $access_token ) { $params = array( - 'name' => $post_details['title'], + 'name' => $post_details['title'], 'description' => $post_details['content'], ); @@ -369,13 +369,12 @@ private function vk_video_post( $post_details, $hashtags, $attachment_path, $arg $attachment = 'video' . $response['owner_id'] . '_' . $response['video_id']; $new_post = array( - 'owner_id' => $response['owner_id'], - 'message' => $post_details['content'] . $hashtags, + 'owner_id' => $response['owner_id'], + 'message' => $post_details['content'] . $hashtags, 'attachments' => empty( $this->share_link_text ) ? $attachment . ',' . $this->get_url( $post_details ) : $attachment, ); return $new_post; - } @@ -395,13 +394,12 @@ private function vk_video_post( $post_details, $hashtags, $attachment_path, $arg private function vk_text_post( $post_details, $hashtags, $args, $owner_id ) { $new_post = array( - 'owner_id' => $owner_id, + 'owner_id' => $owner_id, 'friends_only' => 0, - 'message' => $post_details['content'] . $hashtags, + 'message' => $post_details['content'] . $hashtags, ); return $new_post; - } /** @@ -419,17 +417,16 @@ private function vk_text_post( $post_details, $hashtags, $args, $owner_id ) { private function vk_article_post( $post_details, $hashtags, $args, $owner_id ) { $new_post = array( - 'owner_id' => $owner_id, + 'owner_id' => $owner_id, 'friends_only' => 0, - 'message' => $post_details['content'] . $hashtags, - 'attachments' => $this->get_url( $post_details ), + 'message' => $post_details['content'] . $hashtags, + 'attachments' => $this->get_url( $post_details ), ); if ( ! empty( $this->share_link_text ) ) { unset( $new_post['attachments'] ); } return $new_post; - } /** @@ -459,7 +456,7 @@ public function share( $post_details, $args = array() ) { $post_url = $post_details['post_url']; $share_as_image_post = $post_details['post_with_image']; - $model = new Rop_Post_Format_Model; + $model = new Rop_Post_Format_Model(); $post_format = $model->get_post_format( $post_details['account_id'] ); if ( ! empty( $post_format['share_link_in_comment'] ) && ! empty( $post_format['share_link_text'] ) ) { @@ -546,7 +543,6 @@ public function share( $post_details, $args = array() ) { $this->logger->alert_error( 'Error sharing to Vkontakte' . print_r( $response, true ) ); return false; } - } /** @@ -560,5 +556,4 @@ public function populate_additional_data( $account ) { $account['link'] = sprintf( 'https://vk.com/id%s', $account['id'] ); return $account; } - } diff --git a/includes/admin/services/class-rop-webhook-service.php b/includes/admin/services/class-rop-webhook-service.php index f09010b05..473681f0a 100644 --- a/includes/admin/services/class-rop-webhook-service.php +++ b/includes/admin/services/class-rop-webhook-service.php @@ -93,9 +93,9 @@ public function share( $post_details, $args = array() ) { if ( ! empty( $this->credentials['headers'] ) && is_array( $this->credentials['headers'] ) ) { $headers = array_map( - function( $header ) { + function ( $header ) { if ( ! is_string( $header ) || false === strpos( $header, ':' ) ) { - return false; + return false; } list( $key, $value ) = explode( ':', $header ); @@ -109,7 +109,7 @@ function( $header ) { $headers = array_filter( $headers, - function( $header ) { + function ( $header ) { return $header !== false && is_array( $header ); } ); @@ -127,7 +127,7 @@ function( $header ) { ); if ( ! class_exists( 'ROP_Pro_Webhook_Helper' ) ) { - include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); + include_once ABSPATH . 'wp-admin/includes/plugin.php'; if ( is_plugin_active( 'tweet-old-post-pro/tweet-old-post-pro.php' ) ) { require_once ROP_PRO_PATH . 'includes/helpers/class-rop-pro-webhook-helper.php'; @@ -190,9 +190,9 @@ public function add_webhook( $data ) { $account_id = hash( 'md5', $data['url'] ); $this->service = array( - 'id' => $id, - 'service' => $this->service_name, - 'credentials' => array( + 'id' => $id, + 'service' => $this->service_name, + 'credentials' => array( 'url' => $data['url'], 'headers' => ! empty( $data['headers'] ) && is_array( $data['headers'] ) ? $data['headers'] : array(), 'display_name' => $display_name, @@ -203,7 +203,7 @@ public function add_webhook( $data ) { 'user' => $display_name, 'service' => $this->service_name, 'account' => $this->normalize_string( $data['url'] ), - 'created' => date( 'd/m/Y H:i' ), + 'created' => gmdate( 'd/m/Y H:i' ), 'active' => isset( $data['active'] ) ? $data['active'] : true, ), ), diff --git a/includes/admin/shortners/class-rop-bitly-shortner.php b/includes/admin/shortners/class-rop-bitly-shortner.php index 19e9e6d2f..05a4701b0 100644 --- a/includes/admin/shortners/class-rop-bitly-shortner.php +++ b/includes/admin/shortners/class-rop-bitly-shortner.php @@ -27,7 +27,7 @@ class Rop_Bitly_Shortner extends Rop_Url_Shortner_Abstract { public function init() { $this->service_name = 'bit.ly'; $this->credentials = array( - 'generic_access_token' => '', + 'generic_access_token' => '', ); } diff --git a/includes/admin/shortners/class-rop-firebase-shortner.php b/includes/admin/shortners/class-rop-firebase-shortner.php index 340be91f8..6627b1df7 100644 --- a/includes/admin/shortners/class-rop-firebase-shortner.php +++ b/includes/admin/shortners/class-rop-firebase-shortner.php @@ -27,7 +27,7 @@ class Rop_Firebase_Shortner extends Rop_Url_Shortner_Abstract { public function init() { $this->service_name = 'firebase'; $this->credentials = array( - 'key' => '', + 'key' => '', 'domain' => '', ); } @@ -44,7 +44,10 @@ public function shorten_url( $url ) { $response = $this->callAPI( 'https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=' . $this->credentials['key'], - array( 'method' => 'json', 'json' => true ), + array( + 'method' => 'json', + 'json' => true, + ), array( 'longDynamicLink' => $this->credentials['domain'] . '?link=' . urlencode( $url ) ), array( 'Content-Type' => 'application/json' ) ); diff --git a/includes/admin/shortners/class-rop-isgd-shortner.php b/includes/admin/shortners/class-rop-isgd-shortner.php index 85ba53707..76ad16308 100644 --- a/includes/admin/shortners/class-rop-isgd-shortner.php +++ b/includes/admin/shortners/class-rop-isgd-shortner.php @@ -44,7 +44,7 @@ public function shorten_url( $url ) { array( 'method' => 'get' ), array( 'format' => 'simple', - 'url' => $url, + 'url' => $url, ), null ); diff --git a/includes/admin/shortners/class-rop-owly-shortner.php b/includes/admin/shortners/class-rop-owly-shortner.php index 2b108a3f7..abed603a9 100644 --- a/includes/admin/shortners/class-rop-owly-shortner.php +++ b/includes/admin/shortners/class-rop-owly-shortner.php @@ -43,8 +43,14 @@ public function shorten_url( $url ) { $response = $this->callAPI( 'http://ow.ly/api/1.1/url/shorten', - array( 'method' => 'get', 'json' => true ), - array( 'longUrl' => $url, 'apiKey' => $this->credentials['key'] ), + array( + 'method' => 'get', + 'json' => true, + ), + array( + 'longUrl' => $url, + 'apiKey' => $this->credentials['key'], + ), null ); $shortURL = $url; diff --git a/includes/admin/shortners/class-rop-rebrandly-shortner.php b/includes/admin/shortners/class-rop-rebrandly-shortner.php index 15aa1443f..f9111bb3b 100644 --- a/includes/admin/shortners/class-rop-rebrandly-shortner.php +++ b/includes/admin/shortners/class-rop-rebrandly-shortner.php @@ -27,8 +27,8 @@ class Rop_Rebrandly_Shortner extends Rop_Url_Shortner_Abstract { public function init() { $this->service_name = 'rebrand.ly'; $this->credentials = array( - 'key' => '', - 'domain' => '', + 'key' => '', + 'domain' => '', ); } @@ -50,9 +50,19 @@ public function shorten_url( $url ) { $response = $this->callAPI( 'https://api.rebrandly.com/v1/links', - array( 'method' => 'json', 'json' => true ), - array( 'destination' => $url, 'title' => $title, 'domain' => array( 'id' => $this->credentials['domain'] ) ), - array( 'apikey' => $this->credentials['key'], 'Content-Type' => 'application/json' ) + array( + 'method' => 'json', + 'json' => true, + ), + array( + 'destination' => $url, + 'title' => $title, + 'domain' => array( 'id' => $this->credentials['domain'] ), + ), + array( + 'apikey' => $this->credentials['key'], + 'Content-Type' => 'application/json', + ) ); $shortURL = $url; diff --git a/includes/admin/shortners/class-rop-rvivly-shortner.php b/includes/admin/shortners/class-rop-rvivly-shortner.php index 98da56949..613584a8f 100644 --- a/includes/admin/shortners/class-rop-rvivly-shortner.php +++ b/includes/admin/shortners/class-rop-rvivly-shortner.php @@ -67,7 +67,13 @@ public function shorten_url( $url ) { $response = $this->callAPI( 'https://rviv.ly/yourls-api.php', array( 'method' => 'post' ), - array( 'action' => 'shorturl', 'format' => 'simple', 'signature' => substr( md5( $this->website . md5( 'themeisle' ) ), 0, 10 ), 'url' => $url, 'website' => base64_encode( $this->website ) ), + array( + 'action' => 'shorturl', + 'format' => 'simple', + 'signature' => substr( md5( $this->website . md5( 'themeisle' ) ), 0, 10 ), + 'url' => $url, + 'website' => base64_encode( $this->website ), + ), null ); diff --git a/includes/admin/views/custom_fields_view.php b/includes/admin/views/custom_fields_view.php index d967383c9..2b8f9e3ad 100644 --- a/includes/admin/views/custom_fields_view.php +++ b/includes/admin/views/custom_fields_view.php @@ -1,5 +1,58 @@ +'; + echo '

' . esc_html( $variation_title ) . '

'; + echo '
'; + echo ''; + echo '
'; + echo '
'; + echo '
'; + echo ''; + echo '
'; + echo ''; + echo ''; + echo ''; + echo '
'; + echo '
'; + if ( $show_remove_variation ) { + echo '

' . esc_html( $label_remove_variation ) . '

'; + } + echo ''; +} +?> + - + -

- {$label_variation_number}{$i} -

-
- -
-
-
- -
- - - -
-
-

- {$label_remove_variation} -

- -MULTIPLE_VARIATION_GROUP; - $i ++; - $img_index ++; + $description_value = ( ( ! empty( trim( $field['rop_custom_description'] ) ) ) ? esc_textarea( $field['rop_custom_description'] ) : '' ); + $image_value = ( ! empty( $rop_custom_images_group ) && isset( $rop_custom_images_group[ $img_index ] ) ) ? $rop_custom_images_group[ $img_index ]['rop_custom_image'] : 0; + + $variation_title = $label_variation_number . $i; + render_variation_block( $variation_title, $description_value, $image_value, $i, true ); + + ++$i; + ++$img_index; } } else { - /** - * If the post has no variations, but variations are active - * This one will show as default and first variation. - */ $label_new_variation = Rop_I18n::get_labels( 'post_editor.new_variation' ); - $label_example = Rop_Pro_I18n::get_labels( 'magic_tags.example' ); - $hide_remove = ' style="display:none"'; - - echo << -

- {$label_new_variation} -

-
- -
-
-
- -
- - - -
-
- -MSG_GROUP; - + render_variation_block( $label_new_variation, '', '', 0, false ); } -/** - * The default variation used for cloning - */ -$label_new_variation = Rop_I18n::get_labels( 'post_editor.new_variation' ); -$label_example = Rop_Pro_I18n::get_labels( 'magic_tags.example' ); -$label_remove_variation = Rop_I18n::get_labels( 'post_editor.remove_variation' ); -$hide_remove = ' style="display:none"'; - -echo << -

- {$label_new_variation} -

-
- -
-
-
- -
- - - -
-
-

- {$label_remove_variation} -

- -DEFAULT_GROUP; - -/** - * Button to add new variation. - */ +// Template for cloning - add classes for hidden state +echo '
'; +$label_new_variation = Rop_I18n::get_labels( 'post_editor.new_variation' ); +render_variation_block( $label_new_variation, '', '', 0, true ); +echo '
'; ?> +

- + -

+

\ No newline at end of file diff --git a/includes/class-rop-activator.php b/includes/class-rop-activator.php index 29936369d..dec9adb7e 100644 --- a/includes/class-rop-activator.php +++ b/includes/class-rop-activator.php @@ -46,7 +46,6 @@ public static function activate() { self::rop_create_install_token(); self::rop_set_first_install_date(); - } /** @@ -63,10 +62,9 @@ private static function rop_create_install_token() { $url = get_site_url(); - $token = hash( 'ripemd160', $url . date( 'Y-m-d H:i:s' ) ); + $token = hash( 'ripemd160', $url . gmdate( 'Y-m-d H:i:s' ) ); update_option( ROP_INSTALL_TOKEN_OPTION, $token, false ); - } /** @@ -84,5 +82,4 @@ private static function rop_set_first_install_date() { add_option( 'rop_first_install_date', $install_date, '', 'yes' ); } } - } diff --git a/includes/class-rop-deactivator.php b/includes/class-rop-deactivator.php index cd52ac561..e0a6ce508 100644 --- a/includes/class-rop-deactivator.php +++ b/includes/class-rop-deactivator.php @@ -35,7 +35,5 @@ public static function deactivate() { */ $cron_helper = new Rop_Cron_Helper(); $cron_helper->remove_cron(); - } - } diff --git a/includes/class-rop-i18n.php b/includes/class-rop-i18n.php index 338b1f06d..270cb77b3 100644 --- a/includes/class-rop-i18n.php +++ b/includes/class-rop-i18n.php @@ -45,7 +45,6 @@ public function load_plugin_textdomain() { dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/' ); add_filter( 'rop_available_services', array( $this, 'load_service_locals' ), 99 ); - } /** @@ -56,11 +55,11 @@ public function load_plugin_textdomain() { * @return mixed Services localized. */ public function load_service_locals( $services ) { - $services['facebook']['credentials']['secret']['description'] = Rop_I18n::get_labels( 'accounts.fb_app_secret_title' ); - $services['facebook']['credentials']['app_id']['description'] = Rop_I18n::get_labels( 'accounts.fb_app_id_title' ); - $services['facebook']['description'] = Rop_I18n::get_labels( 'accounts.fb_app_desc' ); - $services['twitter']['description'] = Rop_I18n::get_labels( 'accounts.twt_app_desc' ); - $services['telegram']['description'] = Rop_I18n::get_labels( 'accounts.tlg_app_desc' ); + $services['facebook']['credentials']['secret']['description'] = self::get_labels( 'accounts.fb_app_secret_title' ); + $services['facebook']['credentials']['app_id']['description'] = self::get_labels( 'accounts.fb_app_id_title' ); + $services['facebook']['description'] = self::get_labels( 'accounts.fb_app_desc' ); + $services['twitter']['description'] = self::get_labels( 'accounts.twt_app_desc' ); + $services['telegram']['description'] = self::get_labels( 'accounts.tlg_app_desc' ); return $services; } @@ -80,6 +79,7 @@ public static function get_labels( $key = '' ) { 'service_popup_title' => __( 'Service Credentials', 'tweet-old-post' ), 'show_advance_config' => __( 'Use your own keys', 'tweet-old-post' ), 'show_own_keys_config' => __( 'Use my own API keys', 'tweet-old-post' ), + // translators: %1$s: network name (e.g. "X (Twitter)"). 'tw_app_signin_tooltip' => sprintf( __( 'Due to the %1$s changes in network limits, we cannot guarantee stable sharing using this mode. We recommend using your own API keys.', 'tweet-old-post' ), $tw_new_name ), 'tw_new_name' => $tw_new_name, 'fb_app_signin_btn' => __( 'Sign in to Facebook', 'tweet-old-post' ), @@ -89,7 +89,6 @@ public static function get_labels( $key = '' ) { 'gmb_app_signin_btn' => __( 'Sign in to Google My Business', 'tweet-old-post' ), 'vk_app_signin_btn' => __( 'Sign in to Vkontake', 'tweet-old-post' ), 'app_option_signin' => __( 'Or', 'tweet-old-post' ), - 'service_popup_title' => __( 'Service Credentials', 'tweet-old-post' ), 'sign_in_btn' => __( 'Sign In', 'tweet-old-post' ), 'field_required' => __( 'This field is required', 'tweet-old-post' ), 'at' => __( 'at', 'tweet-old-post' ), @@ -108,14 +107,18 @@ public static function get_labels( $key = '' ) { 'reset_selector_btn' => __( 'Reset', 'tweet-old-post' ), 'for' => __( 'for', 'tweet-old-post' ), 'add_account' => __( 'Add Your Accounts:', 'tweet-old-post' ), + // translators: 1: opening anchor tag, 2: closing anchor tag. 'upsell_accounts' => sprintf( __( 'A maximum of 1 Facebook and Twitter account can be connected to the Lite version of Revive Social. Upgrade to unlock more great features including more social networks! Check out the Lite vs Pro %1$stable here%2$s.', 'tweet-old-post' ), '', '' ), 'upsell_accounts_toggle' => 'Active accounts limit reached.', 'toggle_account' => __( 'Toggle account', 'tweet-old-post' ), 'activate_license' => __( 'You need to activate your license key to unlock the Pro features of Revive Social. Add your key on the sidebar.', 'tweet-old-post' ), 'fb_app_id_title' => __( 'Please add the APP ID from your Facebook app.', 'tweet-old-post' ), 'fb_app_secret_title' => __( 'Please add the APP SECRET from your Facebook app.', 'tweet-old-post' ), + // translators: 1: opening anchor tag, 2: closing anchor tag. 'fb_app_desc' => sprintf( __( 'You can check %1$shere%2$s for how to get these details.', 'tweet-old-post' ), '', '' ), + // translators: 1: opening anchor tag, 2: closing anchor tag. 'twt_app_desc' => sprintf( __( 'You can check %1$shere%2$s for how to get these details.', 'tweet-old-post' ), '', '' ), + // translators: %1$s: network/service name. 'service_error' => __( 'The %1$s service can not be used or was not found', 'tweet-old-post' ), 'twitter_warning' => __( ' @@ -128,189 +131,208 @@ public static function get_labels( $key = '' ) { 'only_in_pro' => __( 'Available in Pro', 'tweet-old-post' ), 'limit_reached' => __( 'Limit reached', 'tweet-old-post' ), 'upsell_upgrade_now' => __( 'Upgrade to PRO', 'tweet-old-post' ), + // translators: %1$s: network name (e.g. "X (Twitter)"). 'upsell_extra_network' => __( 'Sharing to %1$s', 'tweet-old-post' ), + // translators: %1$s: network/service name. 'upsell_extra_account' => __( 'Sharing to Additional %1$s Accounts', 'tweet-old-post' ), + // translators: %1$s: network/service name. 'upsell_service_title' => __( '%1$s is a PRO feature', 'tweet-old-post' ), + // translators: %1$s: network/service name. 'upsell_service_body' => __( 'We\'re sorry, %1$s is not available on your plan. Please upgrade to the Pro plan to unlock all these features and get more traffic.', 'tweet-old-post' ), 'edit_headers' => __( 'Edit Headers', 'tweet-old-post' ), 'hide' => __( 'Hide', 'tweet-old-post' ), 'get_latest_pro_version' => __( 'Get the latest Pro version to unlock.', 'tweet-old-post' ), + // translators: %1$s: opening anchor tag, %2$s: closing anchor tag. 'tlg_app_desc' => sprintf( __( 'You can check %1$shere%2$s for how to get these details.', 'tweet-old-post' ), '', '' ), + // translators: %1$s: network/service name. 'upsell_bz_service_body' => __( 'We\'re sorry, %1$s is not available on your plan. Please upgrade to the business plan to unlock all these features and get more traffic.', 'tweet-old-post' ), 'search_account' => __( 'Search account', 'tweet-old-post' ), 'no_account_found' => __( 'No account found for search', 'tweet-old-post' ), ), 'settings' => array( - 'yes_text' => __( 'Yes', 'tweet-old-post' ), - 'available_in_pro' => __( ' This feature is only available in the Pro version.', 'tweet-old-post' ), - 'post_types_exclude_limit' => sprintf( __( 'Upgrade to Pro version to select more than 30 posts. You can upgrade %1$shere%2$s.', 'tweet-old-post' ), '', '' ), + 'yes_text' => __( 'Yes', 'tweet-old-post' ), + 'available_in_pro' => __( ' This feature is only available in the Pro version.', 'tweet-old-post' ), + // translators: %1$s: opening anchor tag (upgrade link), %2$s: closing anchor tag. + 'post_types_exclude_limit' => sprintf( __( 'Upgrade to Pro version to select more than 30 posts. You can upgrade %1$shere%2$s.', 'tweet-old-post' ), '', '' ), 'post_types_exclude_limit_tooltip' => __( 'Upgrade to Pro version to select more than 30 posts.', 'tweet-old-post' ), - 'menu_item' => __( 'General Settings', 'tweet-old-post' ), - 'min_interval_title' => __( 'Minimum Interval Between Shares', 'tweet-old-post' ), - 'min_interval_desc' => __( 'How many hours between each share?', 'tweet-old-post' ), - 'min_days_title' => __( 'Minimum Post Age', 'tweet-old-post' ), - 'min_days_desc' => __( 'Minimum age of posts available for sharing, in days.', 'tweet-old-post' ), - 'max_days_title' => __( 'Maximum Post Age', 'tweet-old-post' ), - 'max_days_desc' => __( 'Maximum age of posts available for sharing, in days.', 'tweet-old-post' ), - 'no_posts_title' => __( 'Number of Posts', 'tweet-old-post' ), - 'no_posts_desc' => __( 'Number of posts to share per account when a share occurs.', 'tweet-old-post' ), - 'share_once_title' => __( 'Share More Than Once?', 'tweet-old-post' ), - 'share_once_desc' => __( + 'menu_item' => __( 'General Settings', 'tweet-old-post' ), + 'min_interval_title' => __( 'Minimum Interval Between Shares', 'tweet-old-post' ), + 'min_interval_desc' => __( 'How many hours between each share?', 'tweet-old-post' ), + 'min_days_title' => __( 'Minimum Post Age', 'tweet-old-post' ), + 'min_days_desc' => __( 'Minimum age of posts available for sharing, in days.', 'tweet-old-post' ), + 'max_days_title' => __( 'Maximum Post Age', 'tweet-old-post' ), + 'max_days_desc' => __( 'Maximum age of posts available for sharing, in days.', 'tweet-old-post' ), + 'no_posts_title' => __( 'Number of Posts', 'tweet-old-post' ), + 'no_posts_desc' => __( 'Number of posts to share per account when a share occurs.', 'tweet-old-post' ), + 'share_once_title' => __( 'Share More Than Once?', 'tweet-old-post' ), + 'share_once_desc' => __( 'If all available posts have been shared to your active accounts, should we automatically restart the sharing?', 'tweet-old-post' ), - 'post_types_title' => __( 'Post Types', 'tweet-old-post' ), - 'post_types_taxonomy_limit' => sprintf( __( 'Upgrade to Pro version to select more than 4 taxonomies. You can upgrade %1$shere%2$s.', 'tweet-old-post' ), '', '' ), - 'post_types_attachament_info' => sprintf( __( 'You need to select the media files which you want to share, find out more information %1$shere%2$s.', 'tweet-old-post' ), '', '' ), - 'post_types_desc' => __( 'Which post types should Revive Social share? Learn more.', 'tweet-old-post' ), - 'update_post_published_date_title' => __( 'Update Post Published Date After Share', 'tweet-old-post' ), - 'update_post_published_date_desc' => sprintf( __( 'Update the post published date after it has been shared to your social media account. %1$sLearn more%2$s.', 'tweet-old-post' ), '', '' ), - 'filter_by_post_types_desc' => __( 'Filter posts list by Post Type', 'tweet-old-post' ), - 'post_types_upsell' => __( + 'post_types_title' => __( 'Post Types', 'tweet-old-post' ), + // translators: %1$s: opening anchor tag, %2$s: closing anchor tag. + 'post_types_taxonomy_limit' => sprintf( __( 'Upgrade to Pro version to select more than 4 taxonomies. You can upgrade %1$shere%2$s.', 'tweet-old-post' ), '', '' ), + // translators: %1$s: opening anchor tag, %2$s: closing anchor tag. + 'post_types_attachament_info' => sprintf( __( 'You need to select the media files which you want to share, find out more information %1$shere%2$s.', 'tweet-old-post' ), '', '' ), + 'post_types_desc' => __( 'Which post types should Revive Social share? Learn more.', 'tweet-old-post' ), + 'update_post_published_date_title' => __( 'Update Post Published Date After Share', 'tweet-old-post' ), + // translators: %1$s: opening anchor tag (learn more), %2$s: closing anchor tag. + 'update_post_published_date_desc' => sprintf( __( 'Update the post published date after it has been shared to your social media account. %1$sLearn more%2$s.', 'tweet-old-post' ), '', '' ), + 'filter_by_post_types_desc' => __( 'Filter posts list by Post Type', 'tweet-old-post' ), + 'post_types_upsell' => __( 'Selecting custom post types is available in the Pro version.', 'tweet-old-post' ), - 'taxonomies_title' => __( 'Taxonomies', 'tweet-old-post' ), - 'taxonomies_desc' => __( + 'taxonomies_title' => __( 'Taxonomies', 'tweet-old-post' ), + // translators: %1$s: opening anchor tag (learn more), %2$s: closing anchor tag. + 'taxonomies_desc' => __( 'Taxonomies available for the selected post types. Use to include or exclude posts. Learn more.', 'tweet-old-post' ), - 'filter_by_taxonomies_desc' => __( 'Filter posts list by Taxonomy', 'tweet-old-post' ), - 'taxonomies_exclude' => __( 'Exclude?', 'tweet-old-post' ), - 'posts_title' => __( 'Posts', 'tweet-old-post' ), - 'posts_desc' => __( 'Posts excluded from sharing, filtered based on previous selections.', 'tweet-old-post' ), - 'ga_title' => __( 'Enable Google Analytics Tracking', 'tweet-old-post' ), - 'ga_desc' => __( + 'filter_by_taxonomies_desc' => __( 'Filter posts list by Taxonomy', 'tweet-old-post' ), + 'taxonomies_exclude' => __( 'Exclude?', 'tweet-old-post' ), + 'posts_title' => __( 'Posts', 'tweet-old-post' ), + 'posts_desc' => __( 'Posts excluded from sharing, filtered based on previous selections.', 'tweet-old-post' ), + 'ga_title' => __( 'Enable Google Analytics Tracking', 'tweet-old-post' ), + 'ga_desc' => __( 'If checked, UTM query tags will be added to URL of shares so that you can better track traffic from Revive Social.', 'tweet-old-post' ), - 'custom_share_title' => __( 'Enable Share Content Variations', 'tweet-old-post' ), - 'custom_share_desc' => __( 'These messages will override the Post Content option in Post Format settings. You can go to each post and add multiple share content variations. Learn more.', 'tweet-old-post' ), - 'custom_share_order_title' => __( 'Share Message Variations In the Order They Are Added.', 'tweet-old-post' ), - 'custom_share_order_desc' => __( 'By default message variations are shared randomly. Checking this box will cause them to share in the order they were added.', 'tweet-old-post' ), - 'instant_share_title' => __( 'Enable Instant Sharing Feature (Post on Publish)', 'tweet-old-post' ), - 'instant_share_desc' => __( 'Allows you to share posts immediately on publish/update. Learn more.', 'tweet-old-post' ), - 'instant_share_default_title' => __( 'Enable Instant Sharing By Default', 'tweet-old-post' ), - 'instant_share_default_desc' => __( 'Instant sharing option will be checked by default when creating new posts.', 'tweet-old-post' ), - 'cron_type_label' => __( 'Cron Job Type', 'tweet-old-post' ), - 'cron_type_label_desc' => sprintf( __( 'Select the between your local built-in WordPress task scheduler, or Revive Social\'s, %1$sLearn More%2$s.', 'tweet-old-post' ), '', '' ), - 'cron_type_label_desc_terms' => __( 'I understand that some site data is stored on the Revive Social\'s Remote Cron System to provide this service Read More Here.', 'tweet-old-post' ), - 'cron_type_notice' => sprintf( __( '%1$sNOTE:%2$s This is a BETA Remote Cron feature to be used mainly if your %1$sposts aren\'t sharing%2$s. If the Remote Cron feature is used, and you notice that your posts are still not sharing, then please %1$sturn the setting back to "Local Cron"%2$s and read the following guide for alternative solutions that are sure to work: %1$s%3$sLearn More%4$s%2$s.', 'tweet-old-post' ), '', '', '', '' ), - 'housekeeping' => __( 'Housekeeping', 'tweet-old-post' ), - 'housekeeping_desc' => __( 'Should we delete all saved settings on deletion of the Revive Social plugin?', 'tweet-old-post' ), - 'save' => __( 'Save', 'tweet-old-post' ), - 'taxonomies_exclude_explicit' => __( 'Exclude taxononmies', 'tweet-old-post' ), - 'save_filters' => __( 'Save filters', 'tweet-old-post' ), - 'search_posts_to_exclude' => __( 'Search post to exclude...', 'tweet-old-post' ), - 'search_posts_show_excluded' => __( 'Show only excluded posts', 'tweet-old-post' ), - 'exclude_matching' => __( 'Exclude all matching', 'tweet-old-post' ), - 'include_single_post' => __( 'Include this post', 'tweet-old-post' ), - 'exclude_single_post' => __( 'Exclude this post', 'tweet-old-post' ), - 'no_posts_found' => __( 'No posts found.', 'tweet-old-post' ), - 'load_more_posts' => __( 'Load more posts.', 'tweet-old-post' ), - 'min_interval_upsell' => __( 'Choosing a lower interval is available in the Pro version.', 'tweet-old-post' ), - 'tracking_field' => __( 'Contributing', 'tweet-old-post' ), - 'tracking' => __( 'Send anonymous data to help us understand how you use the plugin.', 'tweet-old-post' ), - 'tracking_info' => __( 'What do we track?', 'tweet-old-post' ), + 'custom_share_title' => __( 'Enable Share Content Variations', 'tweet-old-post' ), + 'custom_share_desc' => __( 'These messages will override the Post Content option in Post Format settings. You can go to each post and add multiple share content variations. Learn more.', 'tweet-old-post' ), + 'custom_share_order_title' => __( 'Share Message Variations In the Order They Are Added.', 'tweet-old-post' ), + 'custom_share_order_desc' => __( 'By default message variations are shared randomly. Checking this box will cause them to share in the order they were added.', 'tweet-old-post' ), + 'instant_share_title' => __( 'Enable Instant Sharing Feature (Post on Publish)', 'tweet-old-post' ), + 'instant_share_desc' => __( 'Allows you to share posts immediately on publish/update. Learn more.', 'tweet-old-post' ), + 'instant_share_default_title' => __( 'Enable Instant Sharing By Default', 'tweet-old-post' ), + 'instant_share_default_desc' => __( 'Instant sharing option will be checked by default when creating new posts.', 'tweet-old-post' ), + 'cron_type_label' => __( 'Cron Job Type', 'tweet-old-post' ), + // translators: %1$s: opening anchor tag, %2$s: closing anchor tag. + 'cron_type_label_desc' => sprintf( __( 'Select the between your local built-in WordPress task scheduler, or Revive Social\'s, %1$sLearn More%2$s.', 'tweet-old-post' ), '', '' ), + 'cron_type_label_desc_terms' => __( 'I understand that some site data is stored on the Revive Social\'s Remote Cron System to provide this service Read More Here.', 'tweet-old-post' ), + // translators: %1$s: opening strong tag, %2$s: closing strong tag, %3$s: opening anchor tag with documentation link, %4$s: closing anchor tag. + 'cron_type_notice' => sprintf( __( '%1$sNOTE:%2$s This is a BETA Remote Cron feature to be used mainly if your %1$sposts aren\'t sharing%2$s. If the Remote Cron feature is used, and you notice that your posts are still not sharing, then please %1$sturn the setting back to "Local Cron"%2$s and read the following guide for alternative solutions that are sure to work: %1$s%3$sLearn More%4$s%2$s.', 'tweet-old-post' ), '', '', '', '' ), + 'housekeeping' => __( 'Housekeeping', 'tweet-old-post' ), + 'housekeeping_desc' => __( 'Should we delete all saved settings on deletion of the Revive Social plugin?', 'tweet-old-post' ), + 'save' => __( 'Save', 'tweet-old-post' ), + 'taxonomies_exclude_explicit' => __( 'Exclude taxononmies', 'tweet-old-post' ), + 'save_filters' => __( 'Save filters', 'tweet-old-post' ), + 'search_posts_to_exclude' => __( 'Search post to exclude...', 'tweet-old-post' ), + 'search_posts_show_excluded' => __( 'Show only excluded posts', 'tweet-old-post' ), + 'exclude_matching' => __( 'Exclude all matching', 'tweet-old-post' ), + 'include_single_post' => __( 'Include this post', 'tweet-old-post' ), + 'exclude_single_post' => __( 'Exclude this post', 'tweet-old-post' ), + 'no_posts_found' => __( 'No posts found.', 'tweet-old-post' ), + 'load_more_posts' => __( 'Load more posts.', 'tweet-old-post' ), + 'min_interval_upsell' => __( 'Choosing a lower interval is available in the Pro version.', 'tweet-old-post' ), + 'tracking_field' => __( 'Contributing', 'tweet-old-post' ), + 'tracking' => __( 'Send anonymous data to help us understand how you use the plugin.', 'tweet-old-post' ), + 'tracking_info' => __( 'What do we track?', 'tweet-old-post' ), ), 'post_format' => array( - 'yes_text' => __( 'Yes', 'tweet-old-post' ), - 'menu_item' => __( 'Post Format', 'tweet-old-post' ), + 'yes_text' => __( 'Yes', 'tweet-old-post' ), + 'menu_item' => __( 'Post Format', 'tweet-old-post' ), 'language_title' => __( 'Language', 'tweet-old-post' ), - 'language_title_desc' => __( 'We\'ve detected that this is a multilingual website. Select the post language you want to share to this account.', 'tweet-old-post' ), - 'post_content_title' => __( 'Share Content', 'tweet-old-post' ), - 'post_content_desc' => __( 'Which part of the post should we use as the caption?', 'tweet-old-post' ), - 'post_content_option_title' => __( 'Post Title', 'tweet-old-post' ), - 'post_content_option_content' => __( 'Post Content', 'tweet-old-post' ), - 'post_content_option_title_content' => __( 'Post Title & Content', 'tweet-old-post' ), - 'post_content_option_excerpt' => __( 'Post Excerpt', 'tweet-old-post' ), - 'post_content_option_custom_field' => __( 'Custom Field', 'tweet-old-post' ), - 'post_content_option_custom_content' => __( 'Custom Content', 'tweet-old-post' ), - 'post_content_option_yoast_seo_title' => __( 'Yoast SEO Title', 'tweet-old-post' ), + 'language_title_desc' => __( 'We\'ve detected that this is a multilingual website. Select the post language you want to share to this account.', 'tweet-old-post' ), + 'post_content_title' => __( 'Share Content', 'tweet-old-post' ), + 'post_content_desc' => __( 'Which part of the post should we use as the caption?', 'tweet-old-post' ), + 'post_content_option_title' => __( 'Post Title', 'tweet-old-post' ), + 'post_content_option_content' => __( 'Post Content', 'tweet-old-post' ), + 'post_content_option_title_content' => __( 'Post Title & Content', 'tweet-old-post' ), + 'post_content_option_excerpt' => __( 'Post Excerpt', 'tweet-old-post' ), + 'post_content_option_custom_field' => __( 'Custom Field', 'tweet-old-post' ), + 'post_content_option_custom_content' => __( 'Custom Content', 'tweet-old-post' ), + 'post_content_option_yoast_seo_title' => __( 'Yoast SEO Title', 'tweet-old-post' ), 'post_content_option_yoast_seo_description' => __( 'Yoast SEO Description', 'tweet-old-post' ), 'post_content_option_yoast_seo_title_description' => __( 'Yoast SEO Title & Description', 'tweet-old-post' ), - 'custom_meta_title' => __( 'Custom Meta Field', 'tweet-old-post' ), - 'custom_meta_desc' => __( 'Meta field name from which to get the content.', 'tweet-old-post' ), - 'max_char_title' => __( 'Maximum Characters', 'tweet-old-post' ), - 'max_char_desc' => __( 'Maximum length of the message, in characters. Each letter is considered a character.', 'tweet-old-post' ), - 'add_char_title' => __( 'Additional Text', 'tweet-old-post' ), - 'add_char_title_custom_content' => __( 'Message Content', 'tweet-old-post' ), - 'override_share_variations' => __( 'Override Share Content Variations with the current content', 'tweet-old-post' ), - 'add_char_desc' => sprintf( __( 'Add custom content to shared posts. It supports magic tags in the Pro version of Revive Social %1$sLearn More%2$s', 'tweet-old-post' ), '', '' ), - 'add_char_placeholder' => __( '...written by {author} on {date}.', 'tweet-old-post' ), - 'add_char_placeholder_custom_content' => __( '{title} with {content} written by {author} on {date}.', 'tweet-old-post' ), - 'add_pos_title' => __( 'Choose where you want the Additional Text to appear.', 'tweet-old-post' ), - 'add_pos_option_start' => __( 'Beginning of Caption', 'tweet-old-post' ), - 'add_pos_option_end' => __( 'End of Caption', 'tweet-old-post' ), - 'add_link_title' => __( 'Include Link', 'tweet-old-post' ), - 'add_link_desc' => __( 'Should Revive Social include the post permalink or not?', 'tweet-old-post' ), - 'meta_link_title' => __( 'Custom Field', 'tweet-old-post' ), - 'meta_link_desc' => __( 'Fetch URL from custom field?', 'tweet-old-post' ), - 'meta_link_name_title' => __( 'Custom Field', 'tweet-old-post' ), - 'meta_link_name_desc' => __( 'Custom Field from which to get the URL.', 'tweet-old-post' ), + 'custom_meta_title' => __( 'Custom Meta Field', 'tweet-old-post' ), + 'custom_meta_desc' => __( 'Meta field name from which to get the content.', 'tweet-old-post' ), + 'max_char_title' => __( 'Maximum Characters', 'tweet-old-post' ), + 'max_char_desc' => __( 'Maximum length of the message, in characters. Each letter is considered a character.', 'tweet-old-post' ), + 'add_char_title' => __( 'Additional Text', 'tweet-old-post' ), + 'add_char_title_custom_content' => __( 'Message Content', 'tweet-old-post' ), + 'override_share_variations' => __( 'Override Share Content Variations with the current content', 'tweet-old-post' ), + // translators: %1$s: opening anchor tag, %2$s: closing anchor tag. + 'add_char_desc' => sprintf( __( 'Add custom content to shared posts. It supports magic tags in the Pro version of Revive Social %1$sLearn More%2$s', 'tweet-old-post' ), '', '' ), + 'add_char_placeholder' => __( '...written by {author} on {date}.', 'tweet-old-post' ), + 'add_char_placeholder_custom_content' => __( '{title} with {content} written by {author} on {date}.', 'tweet-old-post' ), + 'add_pos_title' => __( 'Choose where you want the Additional Text to appear.', 'tweet-old-post' ), + 'add_pos_option_start' => __( 'Beginning of Caption', 'tweet-old-post' ), + 'add_pos_option_end' => __( 'End of Caption', 'tweet-old-post' ), + 'add_link_title' => __( 'Include Link', 'tweet-old-post' ), + 'add_link_desc' => __( 'Should Revive Social include the post permalink or not?', 'tweet-old-post' ), + 'meta_link_title' => __( 'Custom Field', 'tweet-old-post' ), + 'meta_link_desc' => __( 'Fetch URL from custom field?', 'tweet-old-post' ), + 'meta_link_name_title' => __( 'Custom Field', 'tweet-old-post' ), + 'meta_link_name_desc' => __( 'Custom Field from which to get the URL.', 'tweet-old-post' ), 'taxonomy_based_sharing_upsell' => __( 'Per account Taxonomy filters feature is available in the Pro version (Personal Plan and higher).', 'tweet-old-post' ), 'message_custom_content_upsell' => __( 'Per account Custom Content feature is available in the Pro version (Personal Plan and higher).', 'tweet-old-post' ), - 'use_shortner_title' => __( 'Use URL Shortener', 'tweet-old-post' ), - 'use_shortner_desc' => __( 'Should we use a shortener when adding the links to the content?', 'tweet-old-post' ), - 'shortner_title' => __( 'URL Shortener Service', 'tweet-old-post' ), - 'shortner_desc' => __( 'Which service to use for URL shortening?', 'tweet-old-post' ), - 'shortner_api_field' => __( 'Service API', 'tweet-old-post' ), - 'shortner_field_desc_start' => __( 'Add the', 'tweet-old-post' ), - 'shortner_field_desc_end' => __( 'required by the', 'tweet-old-post' ), - 'hashtags_title' => __( 'Hashtags', 'tweet-old-post' ), - 'hashtags_desc' => __( 'Hashtags for published content.', 'tweet-old-post' ), - 'hashtags_option_no' => __( 'Don\'t add any hashtags', 'tweet-old-post' ), - 'hashtags_option_common' => __( 'Common hashtags for all shares', 'tweet-old-post' ), - 'hashtags_option_cats' => __( 'Create hashtags from categories', 'tweet-old-post' ), - 'hashtags_option_tags' => __( 'Create hashtags from tags', 'tweet-old-post' ), - 'hashtags_option_field' => __( 'Create hashtags from a custom field', 'tweet-old-post' ), - 'hastags_common_title' => __( 'Common Hashtags', 'tweet-old-post' ), - 'hastags_common_desc' => __( 'List of hastags to use separated by comma', 'tweet-old-post' ), - 'hastags_field_title' => __( 'Custom Hashtags', 'tweet-old-post' ), - 'hastags_field_desc' => __( 'The name of the meta field that contains the hashtags.', 'tweet-old-post' ), - 'hashtags_length_title' => __( 'Maximum Hashtags length', 'tweet-old-post' ), - 'hashtags_length_desc' => __( 'The maximum hashtags length to be used when publishing.', 'tweet-old-post' ), - 'hashtags_randomize' => __( 'Randomize hashtags', 'tweet-old-post' ), - 'hashtags_randomize_desc' => __( 'Randomize the list of hashtags on every successful share. You won\'t see this change in the Sharing Queue, the randomization happens at share time.', 'tweet-old-post' ), - 'image_title' => __( 'Share As Image Post', 'tweet-old-post' ), - 'image_desc' => __( 'Should Revive Social share your posts as an image post? Learn more.', 'tweet-old-post' ), - 'image_aspect_ratio_title' => __( 'Automatically correct aspect ratio', 'tweet-old-post' ), - 'image_aspect_ratio_title_desc' => __( 'Should Revive Social automatically crop images with the wrong aspect ratio? Learn more.', 'tweet-old-post' ), - 'utm_campaign_medium' => __( 'Campaign Medium', 'tweet-old-post' ), - 'utm_campaign_medium_desc' => __( 'The marketing medium you want to show in Google Analytics e.g: "social", "website", etc.', 'tweet-old-post' ), - 'utm_campaign_name' => __( 'Campaign Name', 'tweet-old-post' ), - 'utm_campaign_name_desc' => __( 'The campaign name you want to show in Google Analytics e.g: "november_sale" etc.', 'tweet-old-post' ), - 'custom_utm_upsell' => __( 'Custom UTMs are only available in the Pro version.', 'tweet-old-post' ), - 'image_upsell' => __( 'Sharing as an Image Post is available in the Pro version.', 'tweet-old-post' ), - 'full_wpml_support_upsell' => sprintf( __( 'Language-based sharing only available in the %1$sPro version%2$s', 'tweet-old-post' ), '', '' ), + 'use_shortner_title' => __( 'Use URL Shortener', 'tweet-old-post' ), + 'use_shortner_desc' => __( 'Should we use a shortener when adding the links to the content?', 'tweet-old-post' ), + 'shortner_title' => __( 'URL Shortener Service', 'tweet-old-post' ), + 'shortner_desc' => __( 'Which service to use for URL shortening?', 'tweet-old-post' ), + 'shortner_api_field' => __( 'Service API', 'tweet-old-post' ), + 'shortner_field_desc_start' => __( 'Add the', 'tweet-old-post' ), + 'shortner_field_desc_end' => __( 'required by the', 'tweet-old-post' ), + 'hashtags_title' => __( 'Hashtags', 'tweet-old-post' ), + 'hashtags_desc' => __( 'Hashtags for published content.', 'tweet-old-post' ), + 'hashtags_option_no' => __( 'Don\'t add any hashtags', 'tweet-old-post' ), + 'hashtags_option_common' => __( 'Common hashtags for all shares', 'tweet-old-post' ), + 'hashtags_option_cats' => __( 'Create hashtags from categories', 'tweet-old-post' ), + 'hashtags_option_tags' => __( 'Create hashtags from tags', 'tweet-old-post' ), + 'hashtags_option_field' => __( 'Create hashtags from a custom field', 'tweet-old-post' ), + 'hastags_common_title' => __( 'Common Hashtags', 'tweet-old-post' ), + 'hastags_common_desc' => __( 'List of hastags to use separated by comma', 'tweet-old-post' ), + 'hastags_field_title' => __( 'Custom Hashtags', 'tweet-old-post' ), + 'hastags_field_desc' => __( 'The name of the meta field that contains the hashtags.', 'tweet-old-post' ), + 'hashtags_length_title' => __( 'Maximum Hashtags length', 'tweet-old-post' ), + 'hashtags_length_desc' => __( 'The maximum hashtags length to be used when publishing.', 'tweet-old-post' ), + 'hashtags_randomize' => __( 'Randomize hashtags', 'tweet-old-post' ), + 'hashtags_randomize_desc' => __( 'Randomize the list of hashtags on every successful share. You won\'t see this change in the Sharing Queue, the randomization happens at share time.', 'tweet-old-post' ), + 'image_title' => __( 'Share As Image Post', 'tweet-old-post' ), + 'image_desc' => __( 'Should Revive Social share your posts as an image post? Learn more.', 'tweet-old-post' ), + 'image_aspect_ratio_title' => __( 'Automatically correct aspect ratio', 'tweet-old-post' ), + 'image_aspect_ratio_title_desc' => __( 'Should Revive Social automatically crop images with the wrong aspect ratio? Learn more.', 'tweet-old-post' ), + 'utm_campaign_medium' => __( 'Campaign Medium', 'tweet-old-post' ), + 'utm_campaign_medium_desc' => __( 'The marketing medium you want to show in Google Analytics e.g: "social", "website", etc.', 'tweet-old-post' ), + 'utm_campaign_name' => __( 'Campaign Name', 'tweet-old-post' ), + 'utm_campaign_name_desc' => __( 'The campaign name you want to show in Google Analytics e.g: "november_sale" etc.', 'tweet-old-post' ), + 'custom_utm_upsell' => __( 'Custom UTMs are only available in the Pro version.', 'tweet-old-post' ), + 'image_upsell' => __( 'Sharing as an Image Post is available in the Pro version.', 'tweet-old-post' ), + // translators: %1$s: opening anchor tag, %2$s: closing anchor tag. + 'full_wpml_support_upsell' => sprintf( __( 'Language-based sharing only available in the %1$sPro version%2$s', 'tweet-old-post' ), '', '' ), 'wpml_select_language' => __( 'Choose language', 'tweet-old-post' ), - 'media_post_title' => __( 'Media Posts Content', 'tweet-old-post' ), - 'media_post_desc' => __( 'Which content should we share for media posts?', 'tweet-old-post' ), - 'media_post_option_title' => __( 'Title', 'tweet-old-post' ), - 'media_post_option_caption' => __( 'Caption', 'tweet-old-post' ), - 'media_post_option_alt_text' => __( 'Alt Text', 'tweet-old-post' ), - 'media_post_option_description' => __( 'Description', 'tweet-old-post' ), - 'media_post_upsell' => __( 'Media posting is available in the Business version.', 'tweet-old-post' ), - 'no_post_format_error' => __( 'Post Format option empty, "Share scheduled posts to social media on publish" cannot work. Please go to the Post Format tab and click "Save" for this feature to work', 'tweet-old-post' ), - 'active_account_no_post_format_error' => __( 'No post format found for the following network, please go to "Post Format" tab and save your changes for: ', 'tweet-old-post' ), - 'twitter_max_characters_notice' => sprintf( __( '%1$sNote:%2$s Maximum characters supported by Twitter is 280.', 'tweet-old-post' ), '', '' ), + 'media_post_title' => __( 'Media Posts Content', 'tweet-old-post' ), + 'media_post_desc' => __( 'Which content should we share for media posts?', 'tweet-old-post' ), + 'media_post_option_title' => __( 'Title', 'tweet-old-post' ), + 'media_post_option_caption' => __( 'Caption', 'tweet-old-post' ), + 'media_post_option_alt_text' => __( 'Alt Text', 'tweet-old-post' ), + 'media_post_option_description' => __( 'Description', 'tweet-old-post' ), + 'media_post_upsell' => __( 'Media posting is available in the Business version.', 'tweet-old-post' ), + 'no_post_format_error' => __( 'Post Format option empty, "Share scheduled posts to social media on publish" cannot work. Please go to the Post Format tab and click "Save" for this feature to work', 'tweet-old-post' ), + 'active_account_no_post_format_error' => __( 'No post format found for the following network, please go to "Post Format" tab and save your changes for: ', 'tweet-old-post' ), + // translators: %1$s: opening strong tag, %2$s: closing strong tag. + 'twitter_max_characters_notice' => sprintf( __( '%1$sNote:%2$s Maximum characters supported by Twitter is 280.', 'tweet-old-post' ), '', '' ), + // translators: %1$s: opening strong tag, %2$s: closing strong tag. 'instagram_disable_link_recommendation' => sprintf( __( '%1$sNote:%2$s We recommend that you disable links for Instagram posts. If you do leave this option checked, then we recommend that you enable a shortener.', 'tweet-old-post' ), '', '' ), - 'instagram_image_post_default' => sprintf( __( '%1$sNote:%2$s Instagram posts need to be an image.', 'tweet-old-post' ), '', '' ), - 'vk_unsupported_shorteners' => sprintf( __( '%1$sNote:%2$s is.gd shortener is not currently supported by VK.com.', 'tweet-old-post' ), '', '' ), - 'not_available_with_rop_server' => __( 'This feature is not available for X accounts authorized via Revival Social.', 'tweet-old-post' ), - 'custom_meta_field_upsell' => __( 'Custom meta fields are only available in the Pro version.', 'tweet-old-post' ), - 'custom_meta_upsell' => __( 'Custom fields are only available in the Pro version.', 'tweet-old-post' ), - 'hashtag_field_upsell' => __( 'The selected option is only available in the Pro version.', 'tweet-old-post' ), - 'first_comment_title' => __( 'Comment Text', 'tweet-old-post' ), - 'first_comment_desc' => __( 'Should Revive Social add the post link in the first comment when sharing a post?', 'tweet-old-post' ), - 'first_comment_placeholder' => __( 'Read more on {link}', 'tweet-old-post' ), - 'share_link_title' => __( 'Share link in comment', 'tweet-old-post' ), - 'share_link_desc' => __( 'Share the post link in the first comment?', 'tweet-old-post' ), - 'share_link_upsell' => __( 'Share first comment is only available in the Pro version.', 'tweet-old-post' ), + // translators: %1$s: opening strong tag, %2$s: closing strong tag. + 'instagram_image_post_default' => sprintf( __( '%1$sNote:%2$s Instagram posts need to be an image.', 'tweet-old-post' ), '', '' ), + // translators: %1$s: opening strong tag, %2$s: closing strong tag. + 'vk_unsupported_shorteners' => sprintf( __( '%1$sNote:%2$s is.gd shortener is not currently supported by VK.com.', 'tweet-old-post' ), '', '' ), + 'not_available_with_rop_server' => __( 'This feature is not available for X accounts authorized via Revival Social.', 'tweet-old-post' ), + 'custom_meta_field_upsell' => __( 'Custom meta fields are only available in the Pro version.', 'tweet-old-post' ), + 'custom_meta_upsell' => __( 'Custom fields are only available in the Pro version.', 'tweet-old-post' ), + 'hashtag_field_upsell' => __( 'The selected option is only available in the Pro version.', 'tweet-old-post' ), + 'first_comment_title' => __( 'Comment Text', 'tweet-old-post' ), + 'first_comment_desc' => __( 'Should Revive Social add the post link in the first comment when sharing a post?', 'tweet-old-post' ), + 'first_comment_placeholder' => __( 'Read more on {link}', 'tweet-old-post' ), + 'share_link_title' => __( 'Share link in comment', 'tweet-old-post' ), + 'share_link_desc' => __( 'Share the post link in the first comment?', 'tweet-old-post' ), + 'share_link_upsell' => __( 'Share first comment is only available in the Pro version.', 'tweet-old-post' ), ), 'schedule' => array( 'menu_item' => __( 'Custom Schedule', 'tweet-old-post' ), @@ -332,6 +354,7 @@ public static function get_labels( $key = '' ) { 'sharing_not_started' => __( 'Sharing is not started!', 'tweet-old-post' ), 'sharing_not_started_desc' => __( 'You need to start sharing in order to see any posts in the queue.', 'tweet-old-post' ), 'queue_desc' => __( 'You can choose to edit any of the post, skip the sharing or block a specific one from sharing in the future.', 'tweet-old-post' ), + // translators: 1: opening anchor tag (upsell link), 2: closing anchor tag. 'business_or_higher_only' => sprintf( __( 'You can edit the posts from the queue with the Business or Marketer versions of the plugin. View more details %1$shere%2$s.', 'tweet-old-post' ), '', '' ), 'no_posts' => __( 'No queued posts!', 'tweet-old-post' ), 'no_posts_desc' => __( 'Check if you have at least an "Active account", what posts and pages are selected in "General Settings" and if a "Schedule" is defined.', 'tweet-old-post' ), @@ -362,6 +385,7 @@ public static function get_labels( $key = '' ) { ), 'general' => array( 'plugin_name' => __( 'Revive Social', 'tweet-old-post' ), + // translators: 1: admin URL to plugin dashboard. 'status_error_global' => sprintf( __( 'Issues encountered when trying to share content on social media, check the Logs menu for more information. ', 'tweet-old-post' ), esc_url( get_admin_url( get_current_blog_id(), 'admin.php?page=TweetOldPost' ) ) ), 'sharing_not_started' => __( 'Sharing Not Started', 'tweet-old-post' ), 'sharing_to_account' => __( 'Sharing to Accounts', 'tweet-old-post' ), @@ -382,6 +406,7 @@ public static function get_labels( $key = '' ) { 'next_share' => __( 'Next share', 'tweet-old-post' ), 'sharing_now' => __( 'Sharing...', 'tweet-old-post' ), 'cron_interval' => __( 'Once every 5 min', 'tweet-old-post' ), + // translators: %1$s: opening anchor tag (review link), %2$s: closing anchor tag. 'staging_status' => sprintf( __( 'This seems to be a staging or development website. Some post types will not share to your accounts. %1$sLearn How to Turn Off%2$s', 'tweet-old-post' ), '', '' ), 'api_not_available' => __( 'It seems there is an issue with your WordPress configuration and the core REST API functionality is not available. This is crucial as Revive Social relies on this functionality in order to work.
@@ -398,13 +423,16 @@ public static function get_labels( $key = '' ) { 'rop_docs' => __( 'Documentation', 'tweet-old-post' ), 'rop_roadmap' => __( 'Roadmap & Voting', 'tweet-old-post' ), 'rop_linkedin_refresh_token' => __( 'Your Linkedin access token is about to expire. You need to refresh your LinkedIn token to continue sharing without issue. Paste this link in your browser to find out why and how: https://is.gd/refresh_linkedin_token', 'tweet-old-post' ), + // translators: %1$s: the name of the product. 'license_product' => __( '%1$s license', 'tweet-old-post' ), 'license_help' => __( 'Enter your revive.social license from purchase history in order to get plugin updates.', 'tweet-old-post' ), 'purchase_history' => __( 'Go to Purchase History.', 'tweet-old-post' ), 'activate' => __( 'Activate', 'tweet-old-post' ), 'deactivate' => __( 'Deactivate', 'tweet-old-post' ), 'valid' => __( 'Valid', 'tweet-old-post' ), + // translators: %1$s: expiration date. 'expires' => __( 'Expires on %1$s.', 'tweet-old-post' ), + // translators: %1$s: expiration date. 'expired' => __( 'Expired on %1$s.', 'tweet-old-post' ), 'could_not_change_license' => __( 'Could not change the license.', 'tweet-old-post' ), 'validation_failed' => __( 'Validation failed.', 'tweet-old-post' ), @@ -415,6 +443,7 @@ public static function get_labels( $key = '' ) { 'remove_variation' => __( 'Delete', 'tweet-old-post' ), 'add_variation' => __( 'Add New', 'tweet-old-post' ), 'new_variation' => __( 'New Content Variation', 'tweet-old-post' ), + // translators: %1$s: opening anchor tag (learn more), %2$s: closing anchor tag. 'custom_message_info' => sprintf( __( 'Add share message variations to this post %1$sLearn More%2$s.', 'tweet-old-post' ), '', '' ), 'variation_num' => __( 'Content Variation #', 'tweet-old-post' ), 'variation_image' => __( 'Upload image', 'tweet-old-post' ), @@ -430,93 +459,106 @@ public static function get_labels( $key = '' ) { ), ), 'emails' => array( - 'share_once_sharing_done_subject' => __( 'Revive Social - All Posts Shared', 'tweet-old-post' ), - 'refresh_linkedin_token_subject' => __( 'Revive Social - Refresh Your LinkedIn Token', 'tweet-old-post' ), - 'refresh_linkedin_token_subject_final' => __( 'Final - Refresh Your LinkedIn Token', 'tweet-old-post' ), - 'share_once_sharing_done_message' => __( 'All posts have been shared to your connected social media accounts. No previously shared posts will be re-shared until you click the button to "Stop Sharing" and "Start Sharing" on the Revive Social plugin dashboard.', 'tweet-old-post' ), - 'refresh_linkedin_token_message' => sprintf( __( 'Hi! This email was sent by Revive Social on your website. Your LinkedIn token is about to expire. You need to refresh it to continue sharing without issue. Click the link below to find out why and how: %1$s %2$s', 'tweet-old-post' ), '

', 'https://docs.revive.social/article/1151-how-to-refresh-linkedin-access-token' ), - 'refresh_linkedin_token_message_final' => sprintf( __( 'Hi! This email was sent by Revive Social on your website. Your LinkedIn token is about to expire. You need to refresh it to continue sharing without issue. Click the link below to find out why and how: %1$s %2$s. %3$sThis is the final notice email you will receieve from Revive Social.', 'tweet-old-post' ), '

', 'https://docs.revive.social/article/1151-how-to-refresh-linkedin-access-token', '

' ), + 'share_once_sharing_done_subject' => __( 'Revive Social - All Posts Shared', 'tweet-old-post' ), + 'refresh_linkedin_token_subject' => __( 'Revive Social - Refresh Your LinkedIn Token', 'tweet-old-post' ), + 'refresh_linkedin_token_subject_final' => __( 'Final - Refresh Your LinkedIn Token', 'tweet-old-post' ), + 'share_once_sharing_done_message' => __( 'All posts have been shared to your connected social media accounts. No previously shared posts will be re-shared until you click the button to "Stop Sharing" and "Start Sharing" on the Revive Social plugin dashboard.', 'tweet-old-post' ), + // translators: 1: line break, 2: documentation URL anchor. + 'refresh_linkedin_token_message' => sprintf( __( 'Hi! This email was sent by Revive Social on your website. Your LinkedIn token is about to expire. You need to refresh it to continue sharing without issue. Click the link below to find out why and how: %1$s %2$s', 'tweet-old-post' ), '

', 'https://docs.revive.social/article/1151-how-to-refresh-linkedin-access-token' ), + // translators: 1: line break, 2: documentation URL anchor, 3: line break. + 'refresh_linkedin_token_message_final' => sprintf( __( 'Hi! This email was sent by Revive Social on your website. Your LinkedIn token is about to expire. You need to refresh it to continue sharing without issue. Click the link below to find out why and how: %1$s %2$s. %3$sThis is the final notice email you will receieve from Revive Social.', 'tweet-old-post' ), '

', 'https://docs.revive.social/article/1151-how-to-refresh-linkedin-access-token', '

' ), ), 'cron_system' => array( + // translators: %1$s: line break. 'delete_cron_service_account_info' => sprintf( __( 'This option will delete your website information from our Remote Cron Service. %1$s Revive Social will then fallback to using the Local Cron System built into WordPress. %1$s You can re-enable the Remote Cron System at anytime from General Settings > Cron Type, switch from Local Cron to Remote.', 'tweet-old-post' ), '
' ), - 'clear_local_cron_info' => sprintf( __( 'This will remove the Cron server authentication key from your local database. %1$s A new authentication key will be created when you register to the remote Cron server.', 'tweet-old-post' ), '
' ), + // translators: %1$s: line break. + 'clear_local_cron_info' => sprintf( __( 'This will remove the Cron server authentication key from your local database. %1$s A new authentication key will be created when you register to the remote Cron server.', 'tweet-old-post' ), '
' ), ), - 'notices' => array( - 'revive_network_upsell_notice_title' => sprintf( __( '%1$sRSS Sharing In Revive Social%2$s', 'tweet-old-post' ), '', '' ), - 'revive_network_upsell_notice_body' => sprintf( __( 'Expose your followers to other relevant content sources, and keep their interest by sharing posts from your favorite blogs to your social media accounts.%1$s %2$sRevive Network%3$s is an Addon plugin for Revive Social that lets you share content from any RSS or Atom feed to your connected accounts.', 'tweet-old-post' ), '

', '', '' ), + 'notices' => array( + // translators: %1$s: bold tag, %2$s: closing bold tag. + 'revive_network_upsell_notice_title' => sprintf( __( '%1$sRSS Sharing In Revive Social%2$s', 'tweet-old-post' ), '', '' ), + // translators: %1$s: break tags, %2$s: opening bold tag, %3$s: closing bold tag, %4$s: opening anchor tag with upsell link, %5$s: closing anchor tag. + 'revive_network_upsell_notice_body' => sprintf( __( 'Expose your followers to other relevant content sources, and keep their interest by sharing posts from your favorite blogs to your social media accounts.%1$s %2$sRevive Network%3$s is an Addon plugin for Revive Social that lets you share content from any RSS or Atom feed to your connected accounts.', 'tweet-old-post' ), '

', '', '' ), + // translators: %1$s: break tags, %2$s: opening bold tag, %3$s: closing bold tag. 'revive_network_upsell_notice_product_pag' => sprintf( __( 'Expose your followers to other relevant content sources, and keep their interest by sharing posts from your favorite blogs to your social media accounts.%1$s %2$sRevive Network%3$s is an Addon plugin for Revive Social that lets you share content from any RSS or Atom feed to your connected accounts.', 'tweet-old-post' ), '

', '', '' ), - 'dismiss_permanently' => __( 'Dismiss Permanently', 'tweet-old-post' ), + 'dismiss_permanently' => __( 'Dismiss Permanently', 'tweet-old-post' ), ), // Pro only. 'publish_now' => array( - 'add_account_to_use_instant_share' => __( 'Connect or switch on an account in the Revive Social dashboard to use the Instant Share (Post on Publish) feature.', 'tweet-old-post' ), - 'share_on_update' => __( 'Share via Revive Social ', 'tweet-old-post' ), - 'clear_on_share' => __( 'These checkboxes will be cleared once the post is shared.', 'tweet-old-post' ), - 'custom_instant_share_messages_upsell' => sprintf( __( '%1$sCustom instant share messages are available in the %2$sPro version%3$s of the plugin.%4$s', 'tweet-old-post' ), '', '', '', '' ), - 'edit_message' => __( 'Edit Message', 'tweet-old-post' ), - 'custom_share_message' => __( 'Custom Share Message', 'tweet-old-post' ), - 'custom_share_message_placeholder' => __( 'Write your message here...', 'tweet-old-post' ), - 'instant_sharing' => __( 'Instant Sharing', 'tweet-old-post' ), - 'instant_sharing_desc' => __( 'Before you hit publish, you can select the social accounts where you want to share your post.', 'tweet-old-post' ), - 'share_immediately' => __( 'Share Immediately', 'tweet-old-post' ), - 'add_platform' => __( 'Add Account', 'tweet-old-post' ), - 'queued' => __( 'Posting to social media…', 'tweet-old-post' ), - 'shared_title' => __( 'Post shared!', 'tweet-old-post' ), - 'shared_desc' => __( 'Your post has been shared to the selected social media accounts.', 'tweet-old-post' ), - 'share_failed_title' => __( 'Post not shared!', 'tweet-old-post' ), - 'share_failed_desc' => __( 'There was an issue sharing your post to the selected social media accounts. Please check the logs for more information.', 'tweet-old-post' ), - 'share_partially_shared_title' => __( 'Post partially shared!', 'tweet-old-post' ), - 'share_partially_shared_desc' => __( 'Your post has been shared to some of the selected social media accounts. Please check the logs for more information.', 'tweet-old-post' ), - 'view_history' => __( 'View History', 'tweet-old-post' ), - 'sharing_history' => __( 'Sharing History', 'tweet-old-post' ), - 'account' => __( 'Account', 'tweet-old-post' ), - 'time' => __( 'Time', 'tweet-old-post' ), - 'status' => __( 'Status', 'tweet-old-post' ), - 'reshare_description' => __( 'You can select the social media accounts and click on the "Share Now" button to reshare this post immediately.', 'tweet-old-post' ), - 'reshare_button' => __( 'Share Now', 'tweet-old-post' ), - 'manual_sharing' => __( 'Manual Sharing', 'tweet-old-post' ), - 'manual_sharing_desc' => __( 'You can share your post to social media accounts manually by clicking on the icons.', 'tweet-old-post' ), - 'copied_to_clipboard' => __( 'Sharing link copied to clipboard.', 'tweet-old-post' ), + 'add_account_to_use_instant_share' => __( 'Connect or switch on an account in the Revive Social dashboard to use the Instant Share (Post on Publish) feature.', 'tweet-old-post' ), + 'share_on_update' => __( 'Share via Revive Social ', 'tweet-old-post' ), + 'clear_on_share' => __( 'These checkboxes will be cleared once the post is shared.', 'tweet-old-post' ), + // translators: 1: opening small tag, 2: closing small tag, 3: opening anchor tag with upsell link, 4: closing anchor tag, 5: closing small tag. + 'custom_instant_share_messages_upsell' => sprintf( __( '%1$sCustom instant share messages are available in the %2$sPro version%3$s of the plugin.%4$s', 'tweet-old-post' ), '', '', '', '' ), + 'edit_message' => __( 'Edit Message', 'tweet-old-post' ), + 'custom_share_message' => __( 'Custom Share Message', 'tweet-old-post' ), + 'custom_share_message_placeholder' => __( 'Write your message here...', 'tweet-old-post' ), + 'instant_sharing' => __( 'Instant Sharing', 'tweet-old-post' ), + 'instant_sharing_desc' => __( 'Before you hit publish, you can select the social accounts where you want to share your post.', 'tweet-old-post' ), + 'share_immediately' => __( 'Share Immediately', 'tweet-old-post' ), + 'add_platform' => __( 'Add Account', 'tweet-old-post' ), + 'queued' => __( 'Posting to social media…', 'tweet-old-post' ), + 'shared_title' => __( 'Post shared!', 'tweet-old-post' ), + 'shared_desc' => __( 'Your post has been shared to the selected social media accounts.', 'tweet-old-post' ), + 'share_failed_title' => __( 'Post not shared!', 'tweet-old-post' ), + 'share_failed_desc' => __( 'There was an issue sharing your post to the selected social media accounts. Please check the logs for more information.', 'tweet-old-post' ), + 'share_partially_shared_title' => __( 'Post partially shared!', 'tweet-old-post' ), + 'share_partially_shared_desc' => __( 'Your post has been shared to some of the selected social media accounts. Please check the logs for more information.', 'tweet-old-post' ), + 'view_history' => __( 'View History', 'tweet-old-post' ), + 'sharing_history' => __( 'Sharing History', 'tweet-old-post' ), + 'account' => __( 'Account', 'tweet-old-post' ), + 'time' => __( 'Time', 'tweet-old-post' ), + 'status' => __( 'Status', 'tweet-old-post' ), + 'reshare_description' => __( 'You can select the social media accounts and click on the "Share Now" button to reshare this post immediately.', 'tweet-old-post' ), + 'reshare_button' => __( 'Share Now', 'tweet-old-post' ), + 'manual_sharing' => __( 'Manual Sharing', 'tweet-old-post' ), + 'manual_sharing_desc' => __( 'You can share your post to social media accounts manually by clicking on the icons.', 'tweet-old-post' ), + 'copied_to_clipboard' => __( 'Sharing link copied to clipboard.', 'tweet-old-post' ), ), - 'sharing' => array( - 'post_already_shared' => __( 'This post went out on the last share event and might be a duplicate. Skipping...', 'tweet-old-post' ), - 'share_attempted_on_staging' => __( 'Revive Social has detected that this is a development website. Share process skipped.', 'tweet-old-post' ), - 'reached_sharing_limit' => __( 'You\'ve reached your daily post sharing limit of %1$d posts. Want to share more? Consider upgrading to enjoy a higher limit.', 'tweet-old-post' ), - 'invalid_license' => __( 'Sorry, your license is invalid.', 'tweet-old-post' ), + 'sharing' => array( + 'post_already_shared' => __( 'This post went out on the last share event and might be a duplicate. Skipping...', 'tweet-old-post' ), + 'share_attempted_on_staging' => __( 'Revive Social has detected that this is a development website. Share process skipped.', 'tweet-old-post' ), + // translators: %1$d: number of posts. + 'reached_sharing_limit' => __( 'You\'ve reached your daily post sharing limit of %1$d posts. Want to share more? Consider upgrading to enjoy a higher limit.', 'tweet-old-post' ), + 'invalid_license' => __( 'Sorry, your license is invalid.', 'tweet-old-post' ), 'webhook_extension_not_found' => __( 'Webhook extension not found. Please install the Pro add-on.', 'tweet-old-post' ), - 'webhook_url_not_set' => __( 'Webhook URL not set.', 'tweet-old-post' ), + 'webhook_url_not_set' => __( 'Webhook URL not set.', 'tweet-old-post' ), ), - 'errors' => array( - 'wordpress_api_error' => __( 'Cannot post to network. WordPress Error: ', 'tweet-old-post' ), + 'errors' => array( + 'wordpress_api_error' => __( 'Cannot post to network. WordPress Error: ', 'tweet-old-post' ), 'gmb_failed_access_token_refresh' => __( 'Failed to retrieve Google My Business access token: ', 'tweet-old-post' ), - 'gmb_failed_share' => __( 'Could not share post to Google My Business with LIVE state: ', 'tweet-old-post' ), - 'gmb_no_valid_accounts' => __( 'Google My Business error: No valid accounts found. Please make sure you have access to a Google My Business location.', 'tweet-old-post' ), - 'gmb_missing_main_class' => __( 'Unable to find Google_Client Class. Please ensure you have the Revive Social Pro Addon activated.', 'tweet-old-post' ), - 'gmb_missing_lib_class' => __( 'Unable to find Google_Service_MyBusiness Class. Please ensure you have the Revive Social Pro Addon activated.', 'tweet-old-post' ), + 'gmb_failed_share' => __( 'Could not share post to Google My Business with LIVE state: ', 'tweet-old-post' ), + 'gmb_no_valid_accounts' => __( 'Google My Business error: No valid accounts found. Please make sure you have access to a Google My Business location.', 'tweet-old-post' ), + 'gmb_missing_main_class' => __( 'Unable to find Google_Client Class. Please ensure you have the Revive Social Pro Addon activated.', 'tweet-old-post' ), + 'gmb_missing_lib_class' => __( 'Unable to find Google_Service_MyBusiness Class. Please ensure you have the Revive Social Pro Addon activated.', 'tweet-old-post' ), 'linkedin_missing_exif_imagetype' => __( 'Cannot share image to LinkedIn. exif_imagetype() function is missing from your system. Please contact your web host and ask that this function be enabled on your hosting.', 'tweet-old-post' ), - 'linkedin_issue_fetching_token' => __( 'There was an issue fetching the LinkedIn Token. Please contact Revive Social support for assistance.', 'tweet-old-post' ), - 'no_image_found' => __( 'No image was found for post %1$s cannot share as an image post to: %2$s. Please double check that you have a featured image set.', 'tweet-old-post' ), - 'license_not_active' => __( 'An active Pro license is needed to share to %1$s', 'tweet-old-post' ), - 'could_not_send_webhook' => __( 'Could not send webhook.', 'tweet-old-post' ), - 'webhook_error' => __( 'An error occurred for Webhook post sharing.', 'tweet-old-post' ), + 'linkedin_issue_fetching_token' => __( 'There was an issue fetching the LinkedIn Token. Please contact Revive Social support for assistance.', 'tweet-old-post' ), + // translators: %1$s: post ID, %2$s: social network name. + 'no_image_found' => __( 'No image was found for post %1$s cannot share as an image post to: %2$s. Please double check that you have a featured image set.', 'tweet-old-post' ), + // translators: %1$s: social network name. + 'license_not_active' => __( 'An active Pro license is needed to share to %1$s', 'tweet-old-post' ), + 'could_not_send_webhook' => __( 'Could not send webhook.', 'tweet-old-post' ), + 'webhook_error' => __( 'An error occurred for Webhook post sharing.', 'tweet-old-post' ), ), - 'generic' => array( + 'generic' => array( 'only_pro_suffix' => ' (' . __( 'Available in Pro', 'tweet-old-post' ) . ')', ), - 'misc' => array( - 'curl_not_detected' => __( 'cURL was not detected on your website. Please contact your Web Host and ask that they enable cURL for your website.', 'tweet-old-post' ), - 'no_post_data' => __( 'Post data for share empty.', 'tweet-old-post' ), - 'revive_network_desc' => __( 'Revive Network allows you to share content from multiple RSS or Atom feeds from any website on the web to your connected social media accounts. An active Revive Social Pro subscription is required to download and use Revive Network.', 'tweet-old-post' ), - 'revive_network_learn_more_btn' => __( 'Learn More', 'tweet-old-post' ), - 'learn_more' => __( 'Learn More!', 'tweet-old-post' ), - 'min_interval_6_mins' => __( 'Minimum interval between consecutive shares is 6 minutes.', 'tweet-old-post' ), - 'min_interval_between_shares' => __( 'Lowest allowed value for "Minimum Interval Between Shares" is %s hours. Choosing a lower interval is available in the Pro version.', 'tweet-old-post' ), + 'misc' => array( + 'curl_not_detected' => __( 'cURL was not detected on your website. Please contact your Web Host and ask that they enable cURL for your website.', 'tweet-old-post' ), + 'no_post_data' => __( 'Post data for share empty.', 'tweet-old-post' ), + 'revive_network_desc' => __( 'Revive Network allows you to share content from multiple RSS or Atom feeds from any website on the web to your connected social media accounts. An active Revive Social Pro subscription is required to download and use Revive Network.', 'tweet-old-post' ), + 'revive_network_learn_more_btn' => __( 'Learn More', 'tweet-old-post' ), + 'learn_more' => __( 'Learn More!', 'tweet-old-post' ), + 'min_interval_6_mins' => __( 'Minimum interval between consecutive shares is 6 minutes.', 'tweet-old-post' ), + // translators: %s: number of hours. + 'min_interval_between_shares' => __( 'Lowest allowed value for "Minimum Interval Between Shares" is %s hours. Choosing a lower interval is available in the Pro version.', 'tweet-old-post' ), + // translators: %d: number of minutes. 'min_recurring_schedule_interval' => __( 'Lowest allowed value for "Recurring Schedule Interval" is %d minutes.', 'tweet-old-post' ), - 'no_post_types_selected' => __( 'You need to have at least one post type to share.', 'tweet-old-post' ), - 'min_number_of_concurrent_posts' => __( 'At least one posts need to be shared.', 'tweet-old-post' ), - 'max_number_of_concurrent_posts' => __( 'Maximum concurrent post shares is 4.', 'tweet-old-post' ), + 'no_post_types_selected' => __( 'You need to have at least one post type to share.', 'tweet-old-post' ), + 'min_number_of_concurrent_posts' => __( 'At least one posts need to be shared.', 'tweet-old-post' ), + 'max_number_of_concurrent_posts' => __( 'Maximum concurrent post shares is 4.', 'tweet-old-post' ), ), ); if ( empty( $key ) ) { diff --git a/includes/class-rop-loader.php b/includes/class-rop-loader.php index 227111db5..9165ad172 100644 --- a/includes/class-rop-loader.php +++ b/includes/class-rop-loader.php @@ -50,7 +50,6 @@ public function __construct() { $this->actions = array(); $this->filters = array(); - } /** @@ -106,7 +105,6 @@ private function add( $hooks, $hook, $component, $callback, $priority, $accepted ); return $hooks; - } /** @@ -123,7 +121,5 @@ public function run() { foreach ( $this->actions as $hook ) { add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] ); } - } - } diff --git a/includes/class-rop.php b/includes/class-rop.php index 74276674c..94181e25a 100644 --- a/includes/class-rop.php +++ b/includes/class-rop.php @@ -73,7 +73,6 @@ public function __construct() { $this->load_dependencies(); $this->set_locale(); $this->define_admin_hooks(); - } /** @@ -94,7 +93,6 @@ public function __construct() { */ private function load_dependencies() { $this->loader = new Rop_Loader(); - } /** @@ -111,7 +109,6 @@ private function set_locale() { $plugin_i18n = new Rop_I18n(); $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); - } /** @@ -295,7 +292,6 @@ public function register_service_api_endpoints() { $log->alert_error( 'The service "' . $service . '" can NOT be built or was not found', $exception->getMessage() ); } } - } /** @@ -329,5 +325,4 @@ public function run() { public function get_loader() { return $this->loader; } - } diff --git a/phpcs.xml b/phpcs.xml index 70e12e60b..74a689557 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,66 +1,83 @@ - Themeisle rules for PHP_CodeSnifferr - - . + Themeisle rules for PHP_CodeSnifferr + . - node_modules/* - vendor/* - lib/* - tests/* - assets/* - vue/* - dist/* + node_modules/* + vendor/* + lib/* + tests/* + assets/* + vue/* + dist/* - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + - - 0 - + + + + + + + + + + + + warning + + + + warning + + + + warning + + + + warning + + + + + + + + + \ No newline at end of file diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 0e2cd2e7d..afefe635f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -768,12 +768,6 @@ parameters: count: 1 path: includes/admin/class-rop-admin.php - - - message: '#^Method Rop_Admin\:\:rop_dismiss_cron_disabled_notice\(\) has no return type specified\.$#' - identifier: missingType.return - count: 1 - path: includes/admin/class-rop-admin.php - - message: '#^Method Rop_Admin\:\:rop_dismiss_linkedin_api_v2_notice\(\) has no return type specified\.$#' identifier: missingType.return @@ -918,12 +912,6 @@ parameters: count: 1 path: includes/admin/class-rop-admin.php - - - message: '#^Parameter \#3 \$deprecated of function add_option expects string, null given\.$#' - identifier: argument.type - count: 1 - path: includes/admin/class-rop-admin.php - - message: '#^Parameter \#3 \$deps of function wp_enqueue_style expects array\, string given\.$#' identifier: argument.type @@ -2994,6 +2982,12 @@ parameters: count: 1 path: includes/admin/models/class-rop-queue-model.php + - + message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: includes/admin/models/class-rop-scheduler-model.php + - message: '#^Call to function is_array\(\) with true will always evaluate to false\.$#' identifier: function.impossibleType @@ -3048,12 +3042,6 @@ parameters: count: 1 path: includes/admin/models/class-rop-scheduler-model.php - - - message: '#^Method Rop_Scheduler_Model\:\:get_date\(\) should return int but returns string\.$#' - identifier: return.type - count: 1 - path: includes/admin/models/class-rop-scheduler-model.php - - message: '#^Method Rop_Scheduler_Model\:\:get_schedules\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -3091,14 +3079,14 @@ parameters: path: includes/admin/models/class-rop-scheduler-model.php - - message: '#^Method Rop_Scheduler_Model\:\:update_timeline\(\) has parameter \$new_events with no type specified\.$#' - identifier: missingType.parameter + message: '#^PHPDoc tag @SuppressWarnings has invalid value \(\(PHPMD\.UnusedLocalVariable\)\)\: Unexpected token "\.UnusedLocalVariable\)", expected ''\)'' at offset 89 on line 4$#' + identifier: phpDoc.parseError count: 1 path: includes/admin/models/class-rop-scheduler-model.php - - message: '#^PHPDoc tag @SuppressWarnings has invalid value \(\(PHPMD\.UnusedLocalVariable\)\)\: Unexpected token "\.UnusedLocalVariable\)", expected ''\)'' at offset 89 on line 4$#' - identifier: phpDoc.parseError + message: '#^Parameter \#1 \$new_events of method Rop_Scheduler_Model\:\:update_timeline\(\) expects array\, list given\.$#' + identifier: argument.type count: 1 path: includes/admin/models/class-rop-scheduler-model.php @@ -3366,6 +3354,12 @@ parameters: count: 1 path: includes/admin/models/class-rop-shortners-model.php + - + message: '#^Binary operation "\-" between string and 2 results in an error\.$#' + identifier: binaryOp.invalid + count: 1 + path: includes/admin/notices/class-rop-admin-notices-helpers.php + - message: '#^Method Rop_Admin_Notices_Helpers\:\:rop_notice_dismissed\(\) has no return type specified\.$#' identifier: missingType.return @@ -3648,6 +3642,12 @@ parameters: count: 1 path: includes/admin/services/class-rop-facebook-service.php + - + message: '#^Offset ''rop_facebook…'' on non\-empty\-array in isset\(\) always exists and is not nullable\.$#' + identifier: isset.offset + count: 1 + path: includes/admin/services/class-rop-facebook-service.php + - message: '#^Offset ''source'' on non\-empty\-array in isset\(\) always exists and is not nullable\.$#' identifier: isset.offset @@ -5139,7 +5139,13 @@ parameters: - message: '#^Call to static method get_labels\(\) on an unknown class Rop_Pro_I18n\.$#' identifier: class.notFound - count: 3 + count: 1 + path: includes/admin/views/custom_fields_view.php + + - + message: '#^Parameter \#1 \$text of function esc_attr expects string, int given\.$#' + identifier: argument.type + count: 2 path: includes/admin/views/custom_fields_view.php - @@ -5172,12 +5178,6 @@ parameters: count: 1 path: includes/class-rop-deactivator.php - - - message: '#^Array has 2 duplicate keys with value ''service_popup_title'' \(''service_popup_title'', ''service_popup_title''\)\.$#' - identifier: array.duplicateKey - count: 1 - path: includes/class-rop-i18n.php - - message: '#^Method Rop_I18n\:\:get_labels_frontend\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue diff --git a/tweet-old-post.php b/tweet-old-post.php index 2ccbc2d01..0ce2886a5 100644 --- a/tweet-old-post.php +++ b/tweet-old-post.php @@ -60,7 +60,20 @@ function rop_buffer_present_notice() { ?>
- ', '', '', '', '', '

' ); ?> + tag, 2: tag, 3: tag, 4: tag, 5: tag, 6:

tag + esc_html__( '%1$s %2$sRevive Social:%3$s You have Buffer account(s) connected to Revive Social. You need to remove these accounts to avoid issues with the plugin. Plugin has been deactivated. %4$sClick here to read the article with the fix.%5$s %6$s', 'tweet-old-post' ), + '

', + '', + '', + '', + '', + '

' + ) + ); + ?>
- ', '', '', '', '', '

' ); ?> + tag, 2: tag, 3: tag, 4: tag, 5: tag, 6:

tag + esc_html__( '%1$s You\'re using a PHP version lower than 7.4! Revive Social requires at least %2$sPHP 7.4%3$s to function properly. Plugin has been deactivated. %4$sLearn more here%5$s. %6$s', 'tweet-old-post' ), + '

', + '', + '', + '', + '', + '

' + ); + ?>
ROP_LITE_URL . 'assets/img/logo_rop.png', @@ -249,10 +273,9 @@ function() { $plugin = new Rop(); $plugin->run(); - } -require( plugin_dir_path( __FILE__ ) . '/class-rop-autoloader.php' ); +require plugin_dir_path( __FILE__ ) . '/class-rop-autoloader.php'; Rop_Autoloader::define_namespaces( array( 'Rop' ) ); /** * Invocation of the Autoloader::loader method. diff --git a/uninstall.php b/uninstall.php index 4a3b4dd91..9a36119c5 100644 --- a/uninstall.php +++ b/uninstall.php @@ -32,7 +32,7 @@ if ( is_readable( $vendor_file ) ) { require_once $vendor_file; - require( plugin_dir_path( __FILE__ ) . '/class-rop-autoloader.php' ); + require plugin_dir_path( __FILE__ ) . '/class-rop-autoloader.php'; Rop_Autoloader::define_namespaces( array( 'Rop' ) ); /** * Invocation of the Autoloader::loader method.