From 0e55d52387c29d203a5b4032508721071ceadf50 Mon Sep 17 00:00:00 2001 From: Amit Singh Date: Fri, 7 Apr 2023 11:18:42 +0530 Subject: [PATCH 1/5] phpcs --- .gitignore | 3 + Gruntfile.js | 4 + README.md | 4 +- composer.json | 39 + composer.lock | 1197 ++++++++++++++++++++++++++++ languages/ocean-social-sharing.pot | 120 +-- ocean-social-sharing.php | 6 +- phpcs.xml.dist | 54 ++ readme.txt | 4 +- 9 files changed, 1370 insertions(+), 61 deletions(-) create mode 100644 composer.json create mode 100644 composer.lock create mode 100644 phpcs.xml.dist diff --git a/.gitignore b/.gitignore index 7ec03bb..25a1ea7 100644 --- a/.gitignore +++ b/.gitignore @@ -266,6 +266,9 @@ node_modules/ # build folder build/ +# vendor folder +vendor/ + # Visual Studio 6 build log *.plg diff --git a/Gruntfile.js b/Gruntfile.js index 48c2134..db580e1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -109,11 +109,15 @@ module.exports = function ( grunt ) { '**', '!node_modules/**', '!build/**', + '!vendor/**', '!.git/**', '!changelog.txt', + '!composer.json', + '!composer-lock.json', '!Gruntfile.js', '!package.json', '!package-lock.json', + '!phpcs.xml.dist', '!.csscomb.json', '!.tern-project', '!.gitignore', diff --git a/README.md b/README.md index 2b15aab..24ac002 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ **Contributors:** Nick **Requires at least:** WordPress 5.6 -**Tested up to:** WordPress 6.1.1 -**Stable tag:** 2.0.3 +**Tested up to:** WordPress 6.2 +**Stable tag:** 2.0.4 **License:** GPLv2 or later **License URI:** https://www.gnu.org/licenses/gpl-2.0.html diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..3d9e2de --- /dev/null +++ b/composer.json @@ -0,0 +1,39 @@ +{ + "name": "oceanwp/ocean-social-sharing", + "type": "wordpress-plugin", + "description": "An addon plugin for OceanWP theme.", + "keywords": [ + "WordPress", + "Plugins" + ], + "require-dev": { + "squizlabs/php_codesniffer": "^3.5", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "wptrt/wpthemereview": "^0.2.1", + "wp-coding-standards/wpcs": "^2.2", + "phpcompatibility/phpcompatibility-wp": "^2.1", + "php-parallel-lint/php-parallel-lint": "^1.2.0", + "wp-cli/i18n-command": "^2.2.5" + }, + + "extra": { + "phpcodesniffer-search-depth": 5 + }, + + "scripts": { + "lint:php": [ + "phpcs -p .", + "parallel-lint --exclude .git --exclude vendor --exclude node_modules .", + "phpcs -p . --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 5.6- --ignore=*/vendor/,*/node_modules/" + ], + "lint:wpcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs", + "lint:summary": "@php ./vendor/bin/parallel-lint --exclude .git --exclude vendor --exclude node_modules .", + "make-pot": "wp i18n make-pot . languages/ocean-social-sharing.pot" + }, + + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } + } +} \ No newline at end of file diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..a48761b --- /dev/null +++ b/composer.lock @@ -0,0 +1,1197 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "c2a55e5e427990bc6bb49390d7005583", + "packages": [], + "packages-dev": [ + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.7.2", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "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" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://www.dealerdirect.com", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcbf", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, + "time": "2022-02-04T12:51:07+00:00" + }, + { + "name": "eftec/bladeone", + "version": "3.52", + "source": { + "type": "git", + "url": "https://github.com/EFTEC/BladeOne.git", + "reference": "a19bf66917de0b29836983db87a455a4f6e32148" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/EFTEC/BladeOne/zipball/a19bf66917de0b29836983db87a455a4f6e32148", + "reference": "a19bf66917de0b29836983db87a455a4f6e32148", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.6" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.16.1", + "phpunit/phpunit": "^5.7", + "squizlabs/php_codesniffer": "^3.5.4" + }, + "suggest": { + "eftec/bladeonehtml": "Extension to create forms", + "ext-mbstring": "This extension is used if it's active" + }, + "type": "library", + "autoload": { + "psr-4": { + "eftec\\bladeone\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jorge Patricio Castro Castillo", + "email": "jcastro@eftec.cl" + } + ], + "description": "The standalone version Blade Template Engine from Laravel in a single php file", + "homepage": "https://github.com/EFTEC/BladeOne", + "keywords": [ + "blade", + "php", + "template", + "templating", + "view" + ], + "support": { + "issues": "https://github.com/EFTEC/BladeOne/issues", + "source": "https://github.com/EFTEC/BladeOne/tree/3.52" + }, + "time": "2021-04-17T13:49:01+00:00" + }, + { + "name": "gettext/gettext", + "version": "v4.8.8", + "source": { + "type": "git", + "url": "https://github.com/php-gettext/Gettext.git", + "reference": "302a00aa9d6762c92c884d879c15d3ed05d6a37d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-gettext/Gettext/zipball/302a00aa9d6762c92c884d879c15d3ed05d6a37d", + "reference": "302a00aa9d6762c92c884d879c15d3ed05d6a37d", + "shasum": "" + }, + "require": { + "gettext/languages": "^2.3", + "php": ">=5.4.0" + }, + "require-dev": { + "illuminate/view": "^5.0.x-dev", + "phpunit/phpunit": "^4.8|^5.7|^6.5", + "squizlabs/php_codesniffer": "^3.0", + "symfony/yaml": "~2", + "twig/extensions": "*", + "twig/twig": "^1.31|^2.0" + }, + "suggest": { + "illuminate/view": "Is necessary if you want to use the Blade extractor", + "symfony/yaml": "Is necessary if you want to use the Yaml extractor/generator", + "twig/extensions": "Is necessary if you want to use the Twig extractor", + "twig/twig": "Is necessary if you want to use the Twig extractor" + }, + "type": "library", + "autoload": { + "psr-4": { + "Gettext\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Oscar Otero", + "email": "oom@oscarotero.com", + "homepage": "http://oscarotero.com", + "role": "Developer" + } + ], + "description": "PHP gettext manager", + "homepage": "https://github.com/oscarotero/Gettext", + "keywords": [ + "JS", + "gettext", + "i18n", + "mo", + "po", + "translation" + ], + "support": { + "email": "oom@oscarotero.com", + "issues": "https://github.com/oscarotero/Gettext/issues", + "source": "https://github.com/php-gettext/Gettext/tree/v4.8.8" + }, + "funding": [ + { + "url": "https://paypal.me/oscarotero", + "type": "custom" + }, + { + "url": "https://github.com/oscarotero", + "type": "github" + }, + { + "url": "https://www.patreon.com/misteroom", + "type": "patreon" + } + ], + "time": "2022-12-08T11:59:50+00:00" + }, + { + "name": "gettext/languages", + "version": "2.10.0", + "source": { + "type": "git", + "url": "https://github.com/php-gettext/Languages.git", + "reference": "4d61d67fe83a2ad85959fe6133d6d9ba7dddd1ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-gettext/Languages/zipball/4d61d67fe83a2ad85959fe6133d6d9ba7dddd1ab", + "reference": "4d61d67fe83a2ad85959fe6133d6d9ba7dddd1ab", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5 || ^8.4" + }, + "bin": [ + "bin/export-plural-rules" + ], + "type": "library", + "autoload": { + "psr-4": { + "Gettext\\Languages\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michele Locati", + "email": "mlocati@gmail.com", + "role": "Developer" + } + ], + "description": "gettext languages with plural rules", + "homepage": "https://github.com/php-gettext/Languages", + "keywords": [ + "cldr", + "i18n", + "internationalization", + "l10n", + "language", + "languages", + "localization", + "php", + "plural", + "plural rules", + "plurals", + "translate", + "translations", + "unicode" + ], + "support": { + "issues": "https://github.com/php-gettext/Languages/issues", + "source": "https://github.com/php-gettext/Languages/tree/2.10.0" + }, + "funding": [ + { + "url": "https://paypal.me/mlocati", + "type": "custom" + }, + { + "url": "https://github.com/mlocati", + "type": "github" + } + ], + "time": "2022-10-18T15:00:10+00:00" + }, + { + "name": "mck89/peast", + "version": "v1.15.1", + "source": { + "type": "git", + "url": "https://github.com/mck89/peast.git", + "reference": "cf06286910b7efc9dce7503553ebee314df3d3d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mck89/peast/zipball/cf06286910b7efc9dce7503553ebee314df3d3d3", + "reference": "cf06286910b7efc9dce7503553ebee314df3d3d3", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.15.1-dev" + } + }, + "autoload": { + "psr-4": { + "Peast\\": "lib/Peast/", + "Peast\\test\\": "test/Peast/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Marco Marchiò", + "email": "marco.mm89@gmail.com" + } + ], + "description": "Peast is PHP library that generates AST for JavaScript code", + "support": { + "issues": "https://github.com/mck89/peast/issues", + "source": "https://github.com/mck89/peast/tree/v1.15.1" + }, + "time": "2023-01-21T13:18:17+00:00" + }, + { + "name": "mustache/mustache", + "version": "v2.14.2", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/mustache.php.git", + "reference": "e62b7c3849d22ec55f3ec425507bf7968193a6cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/mustache.php/zipball/e62b7c3849d22ec55f3ec425507bf7968193a6cb", + "reference": "e62b7c3849d22ec55f3ec425507bf7968193a6cb", + "shasum": "" + }, + "require": { + "php": ">=5.2.4" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~1.11", + "phpunit/phpunit": "~3.7|~4.0|~5.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Mustache": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" + } + ], + "description": "A Mustache implementation in PHP.", + "homepage": "https://github.com/bobthecow/mustache.php", + "keywords": [ + "mustache", + "templating" + ], + "support": { + "issues": "https://github.com/bobthecow/mustache.php/issues", + "source": "https://github.com/bobthecow/mustache.php/tree/v2.14.2" + }, + "time": "2022-08-23T13:07:01+00:00" + }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.3.2", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "reference": "6483c9832e71973ed29cf71bd6b3f4fde438a9de", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "0.* || ^1.0", + "squizlabs/php_codesniffer": "^3.6" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.3.2" + }, + "time": "2022-02-21T12:50:22+00:00" + }, + { + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "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." + }, + "type": "phpcodesniffer-standard", + "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", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/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.2", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", + "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || 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", + "phpcs", + "polyfill", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, + "time": "2022-10-25T01:46:02+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.4", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", + "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || 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 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/", + "keywords": [ + "compatibility", + "phpcs", + "standards", + "static analysis", + "wordpress" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, + "time": "2022-10-24T09:00:36+00:00" + }, + { + "name": "rmccue/requests", + "version": "v1.8.1", + "source": { + "type": "git", + "url": "https://github.com/WordPress/Requests.git", + "reference": "82e6936366eac3af4d836c18b9d8c31028fe4cd5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress/Requests/zipball/82e6936366eac3af4d836c18b9d8c31028fe4cd5", + "reference": "82e6936366eac3af4d836c18b9d8c31028fe4cd5", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "php-parallel-lint/php-console-highlighter": "^0.5.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcompatibility/php-compatibility": "^9.0", + "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5", + "requests/test-server": "dev-master", + "squizlabs/php_codesniffer": "^3.5", + "wp-coding-standards/wpcs": "^2.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Requests": "library/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Ryan McCue", + "homepage": "http://ryanmccue.info" + } + ], + "description": "A HTTP library written in PHP, for human beings.", + "homepage": "http://github.com/WordPress/Requests", + "keywords": [ + "curl", + "fsockopen", + "http", + "idna", + "ipv6", + "iri", + "sockets" + ], + "support": { + "issues": "https://github.com/WordPress/Requests/issues", + "source": "https://github.com/WordPress/Requests/tree/v1.8.1" + }, + "time": "2021-06-04T09:56:25+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.7.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2023-02-22T23:07:41+00:00" + }, + { + "name": "symfony/finder", + "version": "v6.2.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/20808dc6631aecafbe67c186af5dcb370be3a0eb", + "reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "symfony/filesystem": "^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v6.2.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-02-16T09:57:23+00:00" + }, + { + "name": "wp-cli/i18n-command", + "version": "v2.4.2", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/i18n-command.git", + "reference": "43d5cf8968dbddf90907083ad048f12be5ca3d43" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/43d5cf8968dbddf90907083ad048f12be5ca3d43", + "reference": "43d5cf8968dbddf90907083ad048f12be5ca3d43", + "shasum": "" + }, + "require": { + "eftec/bladeone": "3.52", + "gettext/gettext": "^4.8", + "mck89/peast": "^1.13.11", + "wp-cli/wp-cli": "^2.5" + }, + "require-dev": { + "wp-cli/scaffold-command": "^1.2 || ^2", + "wp-cli/wp-cli-tests": "^3.1" + }, + "suggest": { + "ext-json": "Used for reading and generating JSON translation files", + "ext-mbstring": "Used for calculating include/exclude matches in code extraction" + }, + "type": "wp-cli-package", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + }, + "bundled": true, + "commands": [ + "i18n", + "i18n make-pot", + "i18n make-json", + "i18n make-mo", + "i18n update-po" + ] + }, + "autoload": { + "files": [ + "i18n-command.php" + ], + "psr-4": { + "WP_CLI\\I18n\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Pascal Birchler", + "homepage": "https://pascalbirchler.com/" + } + ], + "description": "Provides internationalization tools for WordPress projects.", + "homepage": "https://github.com/wp-cli/i18n-command", + "support": { + "issues": "https://github.com/wp-cli/i18n-command/issues", + "source": "https://github.com/wp-cli/i18n-command/tree/v2.4.2" + }, + "time": "2023-02-17T18:14:41+00:00" + }, + { + "name": "wp-cli/mustangostang-spyc", + "version": "0.6.3", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/spyc.git", + "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/spyc/zipball/6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", + "reference": "6aa0b4da69ce9e9a2c8402dab8d43cf32c581cc7", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "4.3.*@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.5.x-dev" + } + }, + "autoload": { + "files": [ + "includes/functions.php" + ], + "psr-4": { + "Mustangostang\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "mustangostang", + "email": "vlad.andersen@gmail.com" + } + ], + "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", + "homepage": "https://github.com/mustangostang/spyc/", + "support": { + "source": "https://github.com/wp-cli/spyc/tree/autoload" + }, + "time": "2017-04-25T11:26:20+00:00" + }, + { + "name": "wp-cli/php-cli-tools", + "version": "v0.11.18", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/php-cli-tools.git", + "reference": "0f503a790698cb36cf835e5c8d09cd4b64bf2325" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/0f503a790698cb36cf835e5c8d09cd4b64bf2325", + "reference": "0f503a790698cb36cf835e5c8d09cd4b64bf2325", + "shasum": "" + }, + "require": { + "php": ">= 5.3.0" + }, + "require-dev": { + "roave/security-advisories": "dev-latest", + "wp-cli/wp-cli-tests": "^3.1.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.11.x-dev" + } + }, + "autoload": { + "files": [ + "lib/cli/cli.php" + ], + "psr-0": { + "cli": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Bachhuber", + "email": "daniel@handbuilt.co", + "role": "Maintainer" + }, + { + "name": "James Logsdon", + "email": "jlogsdon@php.net", + "role": "Developer" + } + ], + "description": "Console utilities for PHP", + "homepage": "http://github.com/wp-cli/php-cli-tools", + "keywords": [ + "cli", + "console" + ], + "support": { + "issues": "https://github.com/wp-cli/php-cli-tools/issues", + "source": "https://github.com/wp-cli/php-cli-tools/tree/v0.11.18" + }, + "time": "2023-04-04T16:03:53+00:00" + }, + { + "name": "wp-cli/wp-cli", + "version": "v2.7.1", + "source": { + "type": "git", + "url": "https://github.com/wp-cli/wp-cli.git", + "reference": "1ddc754f1c15e56fb2cdd1a4e82bd0ec6ca32a76" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/1ddc754f1c15e56fb2cdd1a4e82bd0ec6ca32a76", + "reference": "1ddc754f1c15e56fb2cdd1a4e82bd0ec6ca32a76", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "mustache/mustache": "^2.14.1", + "php": "^5.6 || ^7.0 || ^8.0", + "rmccue/requests": "^1.8", + "symfony/finder": ">2.7", + "wp-cli/mustangostang-spyc": "^0.6.3", + "wp-cli/php-cli-tools": "~0.11.2" + }, + "require-dev": { + "roave/security-advisories": "dev-latest", + "wp-cli/db-command": "^1.3 || ^2", + "wp-cli/entity-command": "^1.2 || ^2", + "wp-cli/extension-command": "^1.1 || ^2", + "wp-cli/package-command": "^1 || ^2", + "wp-cli/wp-cli-tests": "^3.1.6" + }, + "suggest": { + "ext-readline": "Include for a better --prompt implementation", + "ext-zip": "Needed to support extraction of ZIP archives when doing downloads or updates" + }, + "bin": [ + "bin/wp", + "bin/wp.bat" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8.x-dev" + } + }, + "autoload": { + "psr-0": { + "WP_CLI\\": "php/" + }, + "classmap": [ + "php/class-wp-cli.php", + "php/class-wp-cli-command.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "WP-CLI framework", + "homepage": "https://wp-cli.org", + "keywords": [ + "cli", + "wordpress" + ], + "support": { + "docs": "https://make.wordpress.org/cli/handbook/", + "issues": "https://github.com/wp-cli/wp-cli/issues", + "source": "https://github.com/wp-cli/wp-cli" + }, + "time": "2022-10-17T23:10:42+00:00" + }, + { + "name": "wp-coding-standards/wpcs", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", + "reference": "7da1894633f168fe244afc6de00d141f27517b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", + "reference": "7da1894633f168fe244afc6de00d141f27517b62", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "squizlabs/php_codesniffer": "^3.3.1" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", + "phpcompatibility/php-compatibility": "^9.0", + "phpcsstandards/phpcsdevtools": "^1.0", + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", + "keywords": [ + "phpcs", + "standards", + "wordpress" + ], + "support": { + "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", + "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" + }, + { + "name": "Contributors", + "homepage": "https://github.com/WPTRT/WPThemeReview/graphs/contributors" + } + ], + "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" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.3.0" +} diff --git a/languages/ocean-social-sharing.pot b/languages/ocean-social-sharing.pot index 2506612..a6921c6 100644 --- a/languages/ocean-social-sharing.pot +++ b/languages/ocean-social-sharing.pot @@ -1,126 +1,133 @@ -# Copyright (C) 2016 -# This file is distributed under the same license as the package. -#, fuzzy +# Copyright (C) 2023 OceanWP +# This file is distributed under the same license as the Ocean Social Sharing plugin. msgid "" msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: https://wordpress.org/support/theme/style\n" -"POT-Creation-Date: 2020-03-17 22:17+0100\n" +"Project-Id-Version: Ocean Social Sharing 2.0.4\n" +"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ocean-social-sharing\n" +"Last-Translator: OceanWP \n" +"Language-Team: OceanWP \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n" -"Last-Translator: OceanWP\n" -"Language-Team: OceanWP\n" -"X-Generator: Poedit 2.3\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Poedit-Basepath: ..\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Poedit-KeywordsList: _esc_attr__;esc_attr_x;esc_attr_e;esc_html__;" -"esc_html_e;esc_html_x;__;_e;__ngettext:1,2;_n:1,2;" -"__ngettext_noop:1,2;_n_noop:1,2;_c;_nc:4c,1,2;_x:1,2c;_ex:1,2c;" -"_nx:4c,1,2;_nx_noop:4c,1,2;esc_attr__\n" -"X-Textdomain-Support: yes\n" -"Language: en_US\n" -"X-Poedit-SearchPath-0: .\n" - -#: ocean-social-sharing.php:132 ocean-social-sharing.php:141 -msgid "Cheatin’ huh?" -msgstr "" - -#: ocean-social-sharing.php:207 +"POT-Creation-Date: 2023-04-07T05:47:24+00:00\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"X-Generator: WP-CLI 2.7.1\n" +"X-Domain: ocean-social-sharing\n" + +#. Plugin Name of the plugin +msgid "Ocean Social Sharing" +msgstr "" + +#. Plugin URI of the plugin +msgid "https://oceanwp.org/extension/ocean-social-sharing/" +msgstr "" + +#. Description of the plugin +msgid "A simple plugin to add social share buttons to your posts." +msgstr "" + +#. Author of the plugin +msgid "OceanWP" +msgstr "" + +#. Author URI of the plugin +msgid "https://oceanwp.org/" +msgstr "" + +#: ocean-social-sharing.php:242 +#: ocean-social-sharing.php:730 msgid "Social Sharing" msgstr "" -#: ocean-social-sharing.php:232 +#: ocean-social-sharing.php:275 msgid "Sharing Buttons" msgstr "" -#: ocean-social-sharing.php:260 +#: ocean-social-sharing.php:312 msgid "Position" msgstr "" -#: ocean-social-sharing.php:266 +#: ocean-social-sharing.php:318 msgid "Before the Content" msgstr "" -#: ocean-social-sharing.php:267 +#: ocean-social-sharing.php:319 msgid "After the Content" msgstr "" -#: ocean-social-sharing.php:268 +#: ocean-social-sharing.php:320 msgid "Before & After the Content" msgstr "" -#: ocean-social-sharing.php:269 +#: ocean-social-sharing.php:321 msgid "No Buttons in the Content" msgstr "" -#: ocean-social-sharing.php:283 +#: ocean-social-sharing.php:344 msgid "Add Social Name" msgstr "" -#: ocean-social-sharing.php:294 +#: ocean-social-sharing.php:359 msgid "Please Share This" msgstr "" -#: ocean-social-sharing.php:300 +#: ocean-social-sharing.php:370 msgid "Sharing Heading" msgstr "" -#: ocean-social-sharing.php:317 +#: ocean-social-sharing.php:396 msgid "Heading Position" msgstr "" -#: ocean-social-sharing.php:323 +#: ocean-social-sharing.php:402 msgid "Side" msgstr "" -#: ocean-social-sharing.php:324 +#: ocean-social-sharing.php:403 msgid "Top" msgstr "" -#: ocean-social-sharing.php:337 +#: ocean-social-sharing.php:425 msgid "Twitter Username" msgstr "" -#: ocean-social-sharing.php:352 +#: ocean-social-sharing.php:449 msgid "Styling" msgstr "" -#: ocean-social-sharing.php:367 +#: ocean-social-sharing.php:473 msgid "Style" msgstr "" -#: ocean-social-sharing.php:373 +#: ocean-social-sharing.php:479 msgid "Minimal" msgstr "" -#: ocean-social-sharing.php:374 +#: ocean-social-sharing.php:480 msgid "Colored" msgstr "" -#: ocean-social-sharing.php:375 +#: ocean-social-sharing.php:481 msgid "Dark" msgstr "" -#: ocean-social-sharing.php:388 +#: ocean-social-sharing.php:503 msgid "Border Radius" msgstr "" -#: ocean-social-sharing.php:389 +#: ocean-social-sharing.php:504 msgid "Add a custom border radius. px - em - %." msgstr "" -#: ocean-social-sharing.php:405 +#: ocean-social-sharing.php:529 msgid "Minimal Style: Borders Color" msgstr "" -#: ocean-social-sharing.php:420 +#: ocean-social-sharing.php:553 msgid "Minimal Style: Background Color" msgstr "" -#: ocean-social-sharing.php:435 +#: ocean-social-sharing.php:577 msgid "Minimal Style: Color" msgstr "" @@ -136,11 +143,16 @@ msgstr "" msgid "Share on Twitter" msgstr "" -#: template/social-share.php:101 template/social-share.php:124 -#: template/social-share.php:148 template/social-share.php:175 -#: template/social-share.php:205 template/social-share.php:231 -#: template/social-share.php:275 template/social-share.php:298 -#: template/social-share.php:334 template/social-share.php:362 +#: template/social-share.php:101 +#: template/social-share.php:124 +#: template/social-share.php:148 +#: template/social-share.php:175 +#: template/social-share.php:205 +#: template/social-share.php:231 +#: template/social-share.php:275 +#: template/social-share.php:298 +#: template/social-share.php:334 +#: template/social-share.php:362 #: template/social-share.php:396 msgid "Opens in a new window" msgstr "" diff --git a/ocean-social-sharing.php b/ocean-social-sharing.php index 7a15c9e..a7a6fb1 100644 --- a/ocean-social-sharing.php +++ b/ocean-social-sharing.php @@ -3,11 +3,11 @@ * Plugin Name: Ocean Social Sharing * Plugin URI: https://oceanwp.org/extension/ocean-social-sharing/ * Description: A simple plugin to add social share buttons to your posts. - * Version: 2.0.3 + * Version: 2.0.4 * Author: OceanWP * Author URI: https://oceanwp.org/ * Requires at least: 5.6 - * Tested up to: 6.1.1 + * Tested up to: 6.2 * * Text Domain: ocean-social-sharing * Domain Path: /languages @@ -94,7 +94,7 @@ public function __construct( $widget_areas = array() ) $this->token = 'ocean-social-sharing'; $this->plugin_url = plugin_dir_url(__FILE__); $this->plugin_path = plugin_dir_path(__FILE__); - $this->version = '2.0.3'; + $this->version = '2.0.4'; register_activation_hook(__FILE__, array( $this, 'install' )); diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..7182563 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,54 @@ + + + Rules for Ocean Social Sharing + + + + */vendor/* + */node_modules/* + */sass*/* + */build*/* + */assets*/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/readme.txt b/readme.txt index da192d2..1ca3de7 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: oceanwp, apprimit, wpfleek Tags: social, social sharing, social share, share, oceanwp Requires at least: 5.6 -Tested up to: 6.1.1 +Tested up to: 6.2 Requires PHP: 7.2 -Stable tag: 2.0.3 +Stable tag: 2.0.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html From f8f9074df02fae5b64253dee8247186111a25131 Mon Sep 17 00:00:00 2001 From: Amit Singh Date: Tue, 16 May 2023 06:58:48 +0530 Subject: [PATCH 2/5] php 8.2 compatibility --- ocean-social-sharing.php | 1442 +++++++++++++++++++------------------- 1 file changed, 729 insertions(+), 713 deletions(-) diff --git a/ocean-social-sharing.php b/ocean-social-sharing.php index a7a6fb1..0391c79 100644 --- a/ocean-social-sharing.php +++ b/ocean-social-sharing.php @@ -17,9 +17,9 @@ * @author OceanWP */ -// Exit if accessed directly -if (! defined('ABSPATH') ) { - exit; +// Exit if accessed directly. +if ( ! defined( 'ABSPATH' ) ) { + exit; } /** @@ -30,7 +30,7 @@ */ function Ocean_Social_Sharing() { - return Ocean_Social_Sharing::instance(); + return Ocean_Social_Sharing::instance(); } // End Ocean_Social_Sharing() Ocean_Social_Sharing(); @@ -45,186 +45,202 @@ function Ocean_Social_Sharing() */ final class Ocean_Social_Sharing { - /** - * Ocean_Social_Sharing The single instance of Ocean_Social_Sharing. - * - * @var object - * @access private - * @since 1.0.0 - */ - private static $_instance = null; - - /** - * The token. - * - * @var string - * @access public - * @since 1.0.0 - */ - public $token; - - /** - * The version number. - * - * @var string - * @access public - * @since 1.0.0 - */ - public $version; - - // Admin - Start - /** - * The admin object. - * - * @var object - * @access public - * @since 1.0.0 - */ - public $admin; - - /** - * Constructor function. - * - * @access public - * @since 1.0.0 - * @return void - */ - public function __construct( $widget_areas = array() ) - { - $this->token = 'ocean-social-sharing'; - $this->plugin_url = plugin_dir_url(__FILE__); - $this->plugin_path = plugin_dir_path(__FILE__); - $this->version = '2.0.4'; - - register_activation_hook(__FILE__, array( $this, 'install' )); - - add_action('init', array( $this, 'oss_load_plugin_textdomain' )); - - add_filter('ocean_register_tm_strings', array( $this, 'register_tm_strings' )); - - add_action('init', array( $this, 'oss_setup' )); - } - - /** - * Main Ocean_Social_Sharing Instance - * - * Ensures only one instance of Ocean_Social_Sharing is loaded or can be loaded. - * - * @since 1.0.0 - * @static - * @see Ocean_Social_Sharing() - * @return Main Ocean_Social_Sharing instance - */ - public static function instance() - { - if (is_null(self::$_instance) ) { - self::$_instance = new self(); - } - return self::$_instance; - } // End instance() - - /** - * Load the localisation file. - * - * @access public - * @since 1.0.0 - * @return void - */ - public function oss_load_plugin_textdomain() - { - load_plugin_textdomain('ocean-social-sharing', false, dirname(plugin_basename(__FILE__)) . '/languages'); - } - - /** - * Cloning is forbidden. - * - * @since 1.0.0 - */ - public function __clone() - { - _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?'), '1.0.0'); - } - - /** - * Unserializing instances of this class is forbidden. - * - * @since 1.0.0 - */ - public function __wakeup() - { - _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?'), '1.0.0'); - } - - /** - * Installation. - * Runs on activation. Logs the version number and assigns a notice message to a WordPress option. - * - * @access public - * @since 1.0.0 - * @return void - */ - public function install() - { - $this->_log_version_number(); - } - - /** - * Log the plugin version number. - * - * @access private - * @since 1.0.0 - * @return void - */ - private function _log_version_number() - { - // Log the version number. - update_option($this->token . '-version', $this->version); - } - - /** - * Register translation strings - */ - public static function register_tm_strings( $strings ) - { - - $strings['oss_social_share_heading'] = 'Please Share This'; - - return $strings; - - } - - /** - * Setup all the things. - * Only executes if OceanWP or a child theme using OceanWP as a parent is active and the extension specific filter returns true. - * - * @return void - */ - public function oss_setup() - { - $theme = wp_get_theme(); - - if ('OceanWP' == $theme->name || 'oceanwp' == $theme->template ) { - include_once $this->plugin_path . '/includes/helpers.php'; - add_action('customize_register', array( $this, 'customizer_register' )); - add_action('customize_preview_init', array( $this, 'customize_preview_js' )); - add_action('wp_enqueue_scripts', array( $this, 'get_scripts' ), 999); - add_action('ocean_before_single_post_content', array( $this, 'before_content' )); - add_action('ocean_social_share', array( $this, 'after_content' )); - add_filter('ocean_head_css', array( $this, 'head_css' )); - add_filter( 'oe_theme_panels', array( $this, 'oe_theme_panels' ) ); - } - } - - /** - * Customizer Controls and settings - * - * @param WP_Customize_Manager $wp_customize Theme Customizer object. - * @since 1.0.0 - */ - public function customizer_register( $wp_customize ) - { - - if ( OCEAN_EXTRA_ACTIVE + /** + * Ocean_Social_Sharing The single instance of Ocean_Social_Sharing. + * + * @var object + * @access private + * @since 1.0.0 + */ + private static $_instance = null; + + /** + * The token. + * + * @var string + * @access public + * @since 1.0.0 + */ + public $token; + + /** + * The version number. + * + * @var string + * @access public + * @since 1.0.0 + */ + public $version; + + /** + * The plugin url. + * + * @var string + * @access public + */ + public $plugin_url; + + /** + * The plugin path. + * + * @var string + * @access public + */ + public $plugin_path; + + // Admin - Start + /** + * The admin object. + * + * @var object + * @access public + * @since 1.0.0 + */ + public $admin; + + /** + * Constructor function. + * + * @access public + * @since 1.0.0 + * @return void + */ + public function __construct( $widget_areas = array() ) + { + $this->token = 'ocean-social-sharing'; + $this->plugin_url = plugin_dir_url(__FILE__); + $this->plugin_path = plugin_dir_path(__FILE__); + $this->version = '2.0.4'; + + register_activation_hook(__FILE__, array( $this, 'install' )); + + add_action('init', array( $this, 'oss_load_plugin_textdomain' )); + + add_filter('ocean_register_tm_strings', array( $this, 'register_tm_strings' )); + + add_action('init', array( $this, 'oss_setup' )); + } + + /** + * Main Ocean_Social_Sharing Instance + * + * Ensures only one instance of Ocean_Social_Sharing is loaded or can be loaded. + * + * @since 1.0.0 + * @static + * @see Ocean_Social_Sharing() + * @return Main Ocean_Social_Sharing instance + */ + public static function instance() + { + if (is_null(self::$_instance) ) { + self::$_instance = new self(); + } + return self::$_instance; + } // End instance() + + /** + * Load the localisation file. + * + * @access public + * @since 1.0.0 + * @return void + */ + public function oss_load_plugin_textdomain() + { + load_plugin_textdomain('ocean-social-sharing', false, dirname(plugin_basename(__FILE__)) . '/languages'); + } + + /** + * Cloning is forbidden. + * + * @since 1.0.0 + */ + public function __clone() + { + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?'), '1.0.0'); + } + + /** + * Unserializing instances of this class is forbidden. + * + * @since 1.0.0 + */ + public function __wakeup() + { + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?'), '1.0.0'); + } + + /** + * Installation. + * Runs on activation. Logs the version number and assigns a notice message to a WordPress option. + * + * @access public + * @since 1.0.0 + * @return void + */ + public function install() + { + $this->_log_version_number(); + } + + /** + * Log the plugin version number. + * + * @access private + * @since 1.0.0 + * @return void + */ + private function _log_version_number() + { + // Log the version number. + update_option($this->token . '-version', $this->version); + } + + /** + * Register translation strings + */ + public static function register_tm_strings( $strings ) + { + + $strings['oss_social_share_heading'] = 'Please Share This'; + + return $strings; + + } + + /** + * Setup all the things. + * Only executes if OceanWP or a child theme using OceanWP as a parent is active and the extension specific filter returns true. + * + * @return void + */ + public function oss_setup() + { + $theme = wp_get_theme(); + + if ('OceanWP' == $theme->name || 'oceanwp' == $theme->template ) { + include_once $this->plugin_path . '/includes/helpers.php'; + add_action('customize_register', array( $this, 'customizer_register' )); + add_action('customize_preview_init', array( $this, 'customize_preview_js' )); + add_action('wp_enqueue_scripts', array( $this, 'get_scripts' ), 999); + add_action('ocean_before_single_post_content', array( $this, 'before_content' )); + add_action('ocean_social_share', array( $this, 'after_content' )); + add_filter('ocean_head_css', array( $this, 'head_css' )); + add_filter( 'oe_theme_panels', array( $this, 'oe_theme_panels' ) ); + } + } + + /** + * Customizer Controls and settings + * + * @param WP_Customize_Manager $wp_customize Theme Customizer object. + * @since 1.0.0 + */ + public function customizer_register( $wp_customize ) + { + + if ( OCEAN_EXTRA_ACTIVE && class_exists( 'Ocean_Extra_Theme_Panel' ) ) { if ( empty( Ocean_Extra_Theme_Panel::get_setting( 'ocean_social_sharing_panel' ) ) ) { @@ -233,493 +249,493 @@ public function customizer_register( $wp_customize ) } - /** - * Add a new section - */ - $wp_customize->add_section( - 'oss_sharing_section', - array( - 'title' => esc_html__('Social Sharing', 'ocean-social-sharing'), - 'priority' => 210, - ) - ); - - /** - * Sharing sites - */ - $wp_customize->add_setting( - 'oss_social_share_sites', - array( - 'default' => array( - 'twitter', - 'facebook', - 'google_plus', - 'pinterest', - 'linkedin', - 'viber', - 'vk', - 'reddit', - 'tumblr', - 'viadeo', - 'whatsapp', - ), - 'sanitize_callback' => 'oceanwp_sanitize_multi_choices', - ) - ); - - $wp_customize->add_control( - new OceanWP_Customizer_Sortable_Control( - $wp_customize, - 'oss_social_share_sites', - array( - 'label' => esc_html__('Sharing Buttons', 'ocean-social-sharing'), - 'section' => 'oss_sharing_section', - 'settings' => 'oss_social_share_sites', - 'priority' => 10, - 'choices' => array( - 'twitter' => 'Twitter', - 'facebook' => 'Facebook', - 'google_plus' => 'Google Plus', - 'pinterest' => 'Pinterest', - 'linkedin' => 'LinkedIn', - 'viber' => 'Viber', - 'vk' => 'VK', - 'reddit' => 'Reddit', - 'tumblr' => 'Tumblr', - 'viadeo' => 'Viadeo', - 'whatsapp' => 'WhatsApp', - ), - ) - ) - ); - - /** - * Position - */ - $wp_customize->add_setting( - 'oss_social_share_position', - array( - 'default' => 'after', - 'sanitize_callback' => 'oceanwp_sanitize_select', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Control( - $wp_customize, - 'oss_social_share_position', - array( - 'label' => esc_html__('Position', 'ocean-social-sharing'), - 'type' => 'select', - 'section' => 'oss_sharing_section', - 'settings' => 'oss_social_share_position', - 'priority' => 10, - 'choices' => array( - 'before' => esc_html__('Before the Content', 'ocean-social-sharing'), - 'after' => esc_html__('After the Content', 'ocean-social-sharing'), - 'both' => esc_html__('Before & After the Content', 'ocean-social-sharing'), - 'none' => esc_html__('No Buttons in the Content', 'ocean-social-sharing'), - ), - ) - ) - ); - - /** - * Social Name - */ - $wp_customize->add_setting( - 'oss_social_share_name', - array( - 'transport' => 'postMessage', - 'default' => false, - 'sanitize_callback' => 'oceanwp_sanitize_checkbox', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Control( - $wp_customize, - 'oss_social_share_name', - array( - 'label' => esc_html__('Add Social Name', 'ocean-social-sharing'), - 'type' => 'checkbox', - 'section' => 'oss_sharing_section', - 'settings' => 'oss_social_share_name', - 'priority' => 10, - ) - ) - ); - - /** - * Heading - */ - $wp_customize->add_setting( - 'oss_social_share_heading', - array( - 'default' => esc_html__('Please Share This', 'ocean-social-sharing'), - 'transport' => 'postMessage', - 'sanitize_callback' => 'wp_kses_post', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Control( - $wp_customize, - 'oss_social_share_heading', - array( - 'label' => esc_html__('Sharing Heading', 'ocean-social-sharing'), - 'section' => 'oss_sharing_section', - 'settings' => 'oss_social_share_heading', - 'type' => 'text', - 'priority' => 10, - ) - ) - ); - - /** - * Heading Position - */ - $wp_customize->add_setting( - 'oss_social_share_heading_position', - array( - 'transport' => 'postMessage', - 'default' => 'side', - 'sanitize_callback' => 'oceanwp_sanitize_select', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Control( - $wp_customize, - 'oss_social_share_heading_position', - array( - 'label' => esc_html__('Heading Position', 'ocean-social-sharing'), - 'type' => 'select', - 'section' => 'oss_sharing_section', - 'settings' => 'oss_social_share_heading_position', - 'priority' => 10, - 'choices' => array( - 'side' => esc_html__('Side', 'ocean-social-sharing'), - 'top' => esc_html__('Top', 'ocean-social-sharing'), - ), - ) - ) - ); - - /** - * Twitter Handle - */ - $wp_customize->add_setting( - 'oss_social_share_twitter_handle', - array( - 'default' => '', - 'sanitize_callback' => 'wp_filter_nohtml_kses', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Control( - $wp_customize, - 'oss_social_share_twitter_handle', - array( - 'label' => esc_html__('Twitter Username', 'ocean-social-sharing'), - 'section' => 'oss_sharing_section', - 'settings' => 'oss_social_share_twitter_handle', - 'type' => 'text', - 'priority' => 10, - ) - ) - ); - - /** - * Heading Styling - */ - $wp_customize->add_setting( - 'oss_social_share_styling_heading', - array( - 'sanitize_callback' => 'wp_kses', - ) - ); - - $wp_customize->add_control( - new OceanWP_Customizer_Heading_Control( - $wp_customize, - 'oss_social_share_styling_heading', - array( - 'label' => esc_html__('Styling', 'ocean-social-sharing'), - 'section' => 'oss_sharing_section', - 'priority' => 10, - ) - ) - ); - - /** - * Style - */ - $wp_customize->add_setting( - 'oss_social_share_style', - array( - 'transport' => 'postMessage', - 'default' => 'minimal', - 'sanitize_callback' => 'oceanwp_sanitize_select', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Control( - $wp_customize, - 'oss_social_share_style', - array( - 'label' => esc_html__('Style', 'ocean-social-sharing'), - 'type' => 'select', - 'section' => 'oss_sharing_section', - 'settings' => 'oss_social_share_style', - 'priority' => 10, - 'choices' => array( - 'minimal' => esc_html__('Minimal', 'ocean-social-sharing'), - 'colored' => esc_html__('Colored', 'ocean-social-sharing'), - 'dark' => esc_html__('Dark', 'ocean-social-sharing'), - ), - ) - ) - ); - - /** - * Border Radius - */ - $wp_customize->add_setting( - 'oss_social_share_style_border_radius', - array( - 'transport' => 'postMessage', - 'sanitize_callback' => 'wp_kses_post', - ) - ); - - $wp_customize->add_control( - new WP_Customize_Control( - $wp_customize, - 'oss_social_share_style_border_radius', - array( - 'label' => esc_html__('Border Radius', 'ocean-social-sharing'), - 'description' => esc_html__('Add a custom border radius. px - em - %.', 'ocean-social-sharing'), - 'type' => 'text', - 'section' => 'oss_sharing_section', - 'settings' => 'oss_social_share_style_border_radius', - 'priority' => 10, - ) - ) - ); - - /** - * Borders color - */ - $wp_customize->add_setting( - 'oss_sharing_borders_color', - array( - 'transport' => 'postMessage', - 'sanitize_callback' => 'oceanwp_sanitize_color', - ) - ); - - $wp_customize->add_control( - new OceanWP_Customizer_Color_Control( - $wp_customize, - 'oss_sharing_borders_color', - array( - 'label' => esc_html__('Minimal Style: Borders Color', 'ocean-social-sharing'), - 'section' => 'oss_sharing_section', - 'settings' => 'oss_sharing_borders_color', - 'priority' => 10, - ) - ) - ); - - /** - * Icons background color - */ - $wp_customize->add_setting( - 'oss_sharing_icons_bg', - array( - 'transport' => 'postMessage', - 'sanitize_callback' => 'oceanwp_sanitize_color', - ) - ); - - $wp_customize->add_control( - new OceanWP_Customizer_Color_Control( - $wp_customize, - 'oss_sharing_icons_bg', - array( - 'label' => esc_html__('Minimal Style: Background Color', 'ocean-social-sharing'), - 'section' => 'oss_sharing_section', - 'settings' => 'oss_sharing_icons_bg', - 'priority' => 10, - ) - ) - ); - - /** - * Icons color - */ - $wp_customize->add_setting( - 'oss_sharing_icons_color', - array( - 'transport' => 'postMessage', - 'sanitize_callback' => 'oceanwp_sanitize_color', - ) - ); - - $wp_customize->add_control( - new OceanWP_Customizer_Color_Control( - $wp_customize, - 'oss_sharing_icons_color', - array( - 'label' => esc_html__('Minimal Style: Color', 'ocean-social-sharing'), - 'section' => 'oss_sharing_section', - 'settings' => 'oss_sharing_icons_color', - 'priority' => 10, - ) - ) - ); - - } - - /** - * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. - * - * @since 1.0.0 - */ - public function customize_preview_js() - { - wp_enqueue_script('oss-customizer', plugins_url('/assets/js/customizer.min.js', __FILE__), array( 'customize-preview' ), '1.1', true); - } - - /** - * Enqueue scripts. - * - * @since 1.0.0 - */ - public function get_scripts() - { - - // Load main stylesheet - wp_enqueue_style('oss-social-share-style', plugins_url('/assets/css/style.min.css', __FILE__)); - - // Load main script - wp_enqueue_script('oss-social-share-script', plugins_url('/assets/js/social.js', __FILE__), array( 'jquery' ), $this->version, true); - - // If rtl - if (is_RTL() ) { - wp_enqueue_style('oss-social-share-rtl', plugins_url('/assets/css/rtl.css', __FILE__)); - } - - } - - /** - * Social sharing links before content - * - * @since 1.0.8 - */ - public function before_content() - { - - // Return if after content - if ('after' == get_theme_mod('oss_social_share_position', 'after') ) { - return; - } ?> - -
social_share(); ?>
- - social_share(); - - } - - /** - * Social sharing links template - * - * @since 1.0.0 - */ - public function social_share() - { - - $file = $this->plugin_path . 'template/social-share.php'; - $theme_file = get_stylesheet_directory() . '/templates/extra/social-share.php'; - - if (file_exists($theme_file) ) { - $file = $theme_file; - } - - if (file_exists($file) ) { - include $file; - } - - } - - /** - * Add css in head tag. - * - * @since 1.0.0 - */ - public function head_css( $output ) - { - - // Global vars - $sharing_border_radius = get_theme_mod('oss_social_share_style_border_radius'); - $sharing_borders = get_theme_mod('oss_sharing_borders_color'); - $sharing_icons_bg = get_theme_mod('oss_sharing_icons_bg'); - $sharing_icons_color = get_theme_mod('oss_sharing_icons_color'); - - // Define css var - $css = ''; - - // Add border radius - if (! empty($sharing_border_radius) ) { - $css .= '.entry-share ul li a{border-radius:' . $sharing_border_radius . ';}'; - } - - // Add border color - if (! empty($sharing_borders) ) { - $css .= '.entry-share.minimal ul li a{border-color:' . $sharing_borders . ';}'; - } - - // Add icon background - if (! empty($sharing_icons_bg) ) { - $css .= '.entry-share.minimal ul li a{background-color:' . $sharing_icons_bg . ';}'; - } - - // Add icon color - if (! empty($sharing_icons_color) ) { - $css .= '.entry-share.minimal ul li a{color:' . $sharing_icons_color . ';}'; - $css .= '.entry-share.minimal ul li a .oss-icon{fill:' . $sharing_icons_color . ';}'; - } - - // Return CSS - if (! empty($css) ) { - $output .= '/* Social Sharing CSS */' . $css; - } - - // Return output css - return $output; - - } - - /** + /** + * Add a new section + */ + $wp_customize->add_section( + 'oss_sharing_section', + array( + 'title' => esc_html__('Social Sharing', 'ocean-social-sharing'), + 'priority' => 210, + ) + ); + + /** + * Sharing sites + */ + $wp_customize->add_setting( + 'oss_social_share_sites', + array( + 'default' => array( + 'twitter', + 'facebook', + 'google_plus', + 'pinterest', + 'linkedin', + 'viber', + 'vk', + 'reddit', + 'tumblr', + 'viadeo', + 'whatsapp', + ), + 'sanitize_callback' => 'oceanwp_sanitize_multi_choices', + ) + ); + + $wp_customize->add_control( + new OceanWP_Customizer_Sortable_Control( + $wp_customize, + 'oss_social_share_sites', + array( + 'label' => esc_html__('Sharing Buttons', 'ocean-social-sharing'), + 'section' => 'oss_sharing_section', + 'settings' => 'oss_social_share_sites', + 'priority' => 10, + 'choices' => array( + 'twitter' => 'Twitter', + 'facebook' => 'Facebook', + 'google_plus' => 'Google Plus', + 'pinterest' => 'Pinterest', + 'linkedin' => 'LinkedIn', + 'viber' => 'Viber', + 'vk' => 'VK', + 'reddit' => 'Reddit', + 'tumblr' => 'Tumblr', + 'viadeo' => 'Viadeo', + 'whatsapp' => 'WhatsApp', + ), + ) + ) + ); + + /** + * Position + */ + $wp_customize->add_setting( + 'oss_social_share_position', + array( + 'default' => 'after', + 'sanitize_callback' => 'oceanwp_sanitize_select', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Control( + $wp_customize, + 'oss_social_share_position', + array( + 'label' => esc_html__('Position', 'ocean-social-sharing'), + 'type' => 'select', + 'section' => 'oss_sharing_section', + 'settings' => 'oss_social_share_position', + 'priority' => 10, + 'choices' => array( + 'before' => esc_html__('Before the Content', 'ocean-social-sharing'), + 'after' => esc_html__('After the Content', 'ocean-social-sharing'), + 'both' => esc_html__('Before & After the Content', 'ocean-social-sharing'), + 'none' => esc_html__('No Buttons in the Content', 'ocean-social-sharing'), + ), + ) + ) + ); + + /** + * Social Name + */ + $wp_customize->add_setting( + 'oss_social_share_name', + array( + 'transport' => 'postMessage', + 'default' => false, + 'sanitize_callback' => 'oceanwp_sanitize_checkbox', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Control( + $wp_customize, + 'oss_social_share_name', + array( + 'label' => esc_html__('Add Social Name', 'ocean-social-sharing'), + 'type' => 'checkbox', + 'section' => 'oss_sharing_section', + 'settings' => 'oss_social_share_name', + 'priority' => 10, + ) + ) + ); + + /** + * Heading + */ + $wp_customize->add_setting( + 'oss_social_share_heading', + array( + 'default' => esc_html__('Please Share This', 'ocean-social-sharing'), + 'transport' => 'postMessage', + 'sanitize_callback' => 'wp_kses_post', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Control( + $wp_customize, + 'oss_social_share_heading', + array( + 'label' => esc_html__('Sharing Heading', 'ocean-social-sharing'), + 'section' => 'oss_sharing_section', + 'settings' => 'oss_social_share_heading', + 'type' => 'text', + 'priority' => 10, + ) + ) + ); + + /** + * Heading Position + */ + $wp_customize->add_setting( + 'oss_social_share_heading_position', + array( + 'transport' => 'postMessage', + 'default' => 'side', + 'sanitize_callback' => 'oceanwp_sanitize_select', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Control( + $wp_customize, + 'oss_social_share_heading_position', + array( + 'label' => esc_html__('Heading Position', 'ocean-social-sharing'), + 'type' => 'select', + 'section' => 'oss_sharing_section', + 'settings' => 'oss_social_share_heading_position', + 'priority' => 10, + 'choices' => array( + 'side' => esc_html__('Side', 'ocean-social-sharing'), + 'top' => esc_html__('Top', 'ocean-social-sharing'), + ), + ) + ) + ); + + /** + * Twitter Handle + */ + $wp_customize->add_setting( + 'oss_social_share_twitter_handle', + array( + 'default' => '', + 'sanitize_callback' => 'wp_filter_nohtml_kses', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Control( + $wp_customize, + 'oss_social_share_twitter_handle', + array( + 'label' => esc_html__('Twitter Username', 'ocean-social-sharing'), + 'section' => 'oss_sharing_section', + 'settings' => 'oss_social_share_twitter_handle', + 'type' => 'text', + 'priority' => 10, + ) + ) + ); + + /** + * Heading Styling + */ + $wp_customize->add_setting( + 'oss_social_share_styling_heading', + array( + 'sanitize_callback' => 'wp_kses', + ) + ); + + $wp_customize->add_control( + new OceanWP_Customizer_Heading_Control( + $wp_customize, + 'oss_social_share_styling_heading', + array( + 'label' => esc_html__('Styling', 'ocean-social-sharing'), + 'section' => 'oss_sharing_section', + 'priority' => 10, + ) + ) + ); + + /** + * Style + */ + $wp_customize->add_setting( + 'oss_social_share_style', + array( + 'transport' => 'postMessage', + 'default' => 'minimal', + 'sanitize_callback' => 'oceanwp_sanitize_select', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Control( + $wp_customize, + 'oss_social_share_style', + array( + 'label' => esc_html__('Style', 'ocean-social-sharing'), + 'type' => 'select', + 'section' => 'oss_sharing_section', + 'settings' => 'oss_social_share_style', + 'priority' => 10, + 'choices' => array( + 'minimal' => esc_html__('Minimal', 'ocean-social-sharing'), + 'colored' => esc_html__('Colored', 'ocean-social-sharing'), + 'dark' => esc_html__('Dark', 'ocean-social-sharing'), + ), + ) + ) + ); + + /** + * Border Radius + */ + $wp_customize->add_setting( + 'oss_social_share_style_border_radius', + array( + 'transport' => 'postMessage', + 'sanitize_callback' => 'wp_kses_post', + ) + ); + + $wp_customize->add_control( + new WP_Customize_Control( + $wp_customize, + 'oss_social_share_style_border_radius', + array( + 'label' => esc_html__('Border Radius', 'ocean-social-sharing'), + 'description' => esc_html__('Add a custom border radius. px - em - %.', 'ocean-social-sharing'), + 'type' => 'text', + 'section' => 'oss_sharing_section', + 'settings' => 'oss_social_share_style_border_radius', + 'priority' => 10, + ) + ) + ); + + /** + * Borders color + */ + $wp_customize->add_setting( + 'oss_sharing_borders_color', + array( + 'transport' => 'postMessage', + 'sanitize_callback' => 'oceanwp_sanitize_color', + ) + ); + + $wp_customize->add_control( + new OceanWP_Customizer_Color_Control( + $wp_customize, + 'oss_sharing_borders_color', + array( + 'label' => esc_html__('Minimal Style: Borders Color', 'ocean-social-sharing'), + 'section' => 'oss_sharing_section', + 'settings' => 'oss_sharing_borders_color', + 'priority' => 10, + ) + ) + ); + + /** + * Icons background color + */ + $wp_customize->add_setting( + 'oss_sharing_icons_bg', + array( + 'transport' => 'postMessage', + 'sanitize_callback' => 'oceanwp_sanitize_color', + ) + ); + + $wp_customize->add_control( + new OceanWP_Customizer_Color_Control( + $wp_customize, + 'oss_sharing_icons_bg', + array( + 'label' => esc_html__('Minimal Style: Background Color', 'ocean-social-sharing'), + 'section' => 'oss_sharing_section', + 'settings' => 'oss_sharing_icons_bg', + 'priority' => 10, + ) + ) + ); + + /** + * Icons color + */ + $wp_customize->add_setting( + 'oss_sharing_icons_color', + array( + 'transport' => 'postMessage', + 'sanitize_callback' => 'oceanwp_sanitize_color', + ) + ); + + $wp_customize->add_control( + new OceanWP_Customizer_Color_Control( + $wp_customize, + 'oss_sharing_icons_color', + array( + 'label' => esc_html__('Minimal Style: Color', 'ocean-social-sharing'), + 'section' => 'oss_sharing_section', + 'settings' => 'oss_sharing_icons_color', + 'priority' => 10, + ) + ) + ); + + } + + /** + * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. + * + * @since 1.0.0 + */ + public function customize_preview_js() + { + wp_enqueue_script('oss-customizer', plugins_url('/assets/js/customizer.min.js', __FILE__), array( 'customize-preview' ), '1.1', true); + } + + /** + * Enqueue scripts. + * + * @since 1.0.0 + */ + public function get_scripts() + { + + // Load main stylesheet + wp_enqueue_style('oss-social-share-style', plugins_url('/assets/css/style.min.css', __FILE__)); + + // Load main script + wp_enqueue_script('oss-social-share-script', plugins_url('/assets/js/social.js', __FILE__), array( 'jquery' ), $this->version, true); + + // If rtl + if (is_RTL() ) { + wp_enqueue_style('oss-social-share-rtl', plugins_url('/assets/css/rtl.css', __FILE__)); + } + + } + + /** + * Social sharing links before content + * + * @since 1.0.8 + */ + public function before_content() + { + + // Return if after content + if ('after' == get_theme_mod('oss_social_share_position', 'after') ) { + return; + } ?> + +
social_share(); ?>
+ + social_share(); + + } + + /** + * Social sharing links template + * + * @since 1.0.0 + */ + public function social_share() + { + + $file = $this->plugin_path . 'template/social-share.php'; + $theme_file = get_stylesheet_directory() . '/templates/extra/social-share.php'; + + if (file_exists($theme_file) ) { + $file = $theme_file; + } + + if (file_exists($file) ) { + include $file; + } + + } + + /** + * Add css in head tag. + * + * @since 1.0.0 + */ + public function head_css( $output ) + { + + // Global vars + $sharing_border_radius = get_theme_mod('oss_social_share_style_border_radius'); + $sharing_borders = get_theme_mod('oss_sharing_borders_color'); + $sharing_icons_bg = get_theme_mod('oss_sharing_icons_bg'); + $sharing_icons_color = get_theme_mod('oss_sharing_icons_color'); + + // Define css var + $css = ''; + + // Add border radius + if (! empty($sharing_border_radius) ) { + $css .= '.entry-share ul li a{border-radius:' . $sharing_border_radius . ';}'; + } + + // Add border color + if (! empty($sharing_borders) ) { + $css .= '.entry-share.minimal ul li a{border-color:' . $sharing_borders . ';}'; + } + + // Add icon background + if (! empty($sharing_icons_bg) ) { + $css .= '.entry-share.minimal ul li a{background-color:' . $sharing_icons_bg . ';}'; + } + + // Add icon color + if (! empty($sharing_icons_color) ) { + $css .= '.entry-share.minimal ul li a{color:' . $sharing_icons_color . ';}'; + $css .= '.entry-share.minimal ul li a .oss-icon{fill:' . $sharing_icons_color . ';}'; + } + + // Return CSS + if (! empty($css) ) { + $output .= '/* Social Sharing CSS */' . $css; + } + + // Return output css + return $output; + + } + + /** * Add social sharing switcher. * * @since 1.0.0 @@ -741,48 +757,48 @@ public function oe_theme_panels( $panels ) { // -------------------------------------------------------------------------------- if (! function_exists('ocean_social_sharing_fs') ) { - // Create a helper function for easy SDK access. - function ocean_social_sharing_fs() - { - global $ocean_social_sharing_fs; - - if (! isset($ocean_social_sharing_fs) ) { - $ocean_social_sharing_fs = OceanWP_EDD_Addon_Migration::instance('ocean_social_sharing_fs')->init_sdk( - array( - 'id' => '3807', - 'slug' => 'ocean-social-sharing', - 'public_key' => 'pk_0aa6121ff893b29efa9a58d6c0ad5', - 'is_premium' => false, - 'is_premium_only' => false, - 'has_paid_plans' => false, - ) - ); - } - - return $ocean_social_sharing_fs; - } - - function ocean_social_sharing_fs_addon_init() - { - if (class_exists('Ocean_Extra') ) { - OceanWP_EDD_Addon_Migration::instance('ocean_social_sharing_fs')->init(); - } - } - - if (0 == did_action('owp_fs_loaded') ) { - // Init add-on only after parent theme was loaded. - add_action('owp_fs_loaded', 'ocean_social_sharing_fs_addon_init', 15); - } else { - if (class_exists('Ocean_Extra') ) { - /** - * This makes sure that if the theme was already loaded - * before the plugin, it will run Freemius right away. - * - * This is crucial for the plugin's activation hook. - */ - ocean_social_sharing_fs_addon_init(); - } - } + // Create a helper function for easy SDK access. + function ocean_social_sharing_fs() + { + global $ocean_social_sharing_fs; + + if (! isset($ocean_social_sharing_fs) ) { + $ocean_social_sharing_fs = OceanWP_EDD_Addon_Migration::instance('ocean_social_sharing_fs')->init_sdk( + array( + 'id' => '3807', + 'slug' => 'ocean-social-sharing', + 'public_key' => 'pk_0aa6121ff893b29efa9a58d6c0ad5', + 'is_premium' => false, + 'is_premium_only' => false, + 'has_paid_plans' => false, + ) + ); + } + + return $ocean_social_sharing_fs; + } + + function ocean_social_sharing_fs_addon_init() + { + if (class_exists('Ocean_Extra') ) { + OceanWP_EDD_Addon_Migration::instance('ocean_social_sharing_fs')->init(); + } + } + + if (0 == did_action('owp_fs_loaded') ) { + // Init add-on only after parent theme was loaded. + add_action('owp_fs_loaded', 'ocean_social_sharing_fs_addon_init', 15); + } else { + if (class_exists('Ocean_Extra') ) { + /** + * This makes sure that if the theme was already loaded + * before the plugin, it will run Freemius right away. + * + * This is crucial for the plugin's activation hook. + */ + ocean_social_sharing_fs_addon_init(); + } + } } // endregion From 994f124747a221c8a957ac10c580801b0c80f5c3 Mon Sep 17 00:00:00 2001 From: Amit Singh Date: Wed, 17 May 2023 14:28:31 +0530 Subject: [PATCH 3/5] changelog --- changelog.txt | 3 +++ readme.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/changelog.txt b/changelog.txt index 8314c22..e02e6f2 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,8 @@ == Changelog == += 2.0.4 - MAY 17 2023 = +- Compatibility: PHP 8.2: Creation of dynamic property Ocean_Social_Sharing::$plugin_path and Ocean_Social_Sharing::$plugin_url is deprecated. + = 2.0.3 - MAR 29 2023 = - Updated: Version numbers for compatibility. diff --git a/readme.txt b/readme.txt index 1ca3de7..e56e8ee 100644 --- a/readme.txt +++ b/readme.txt @@ -56,6 +56,9 @@ This plugin will only function with the [OceanWP](https://oceanwp.org/) theme. == Changelog == += 2.0.4 - MAY 17 2023 = +- Compatibility: PHP 8.2: Creation of dynamic property Ocean_Social_Sharing::$plugin_path and Ocean_Social_Sharing::$plugin_url is deprecated. + = 2.0.3 - MAR 29 2023 = - Updated: Version numbers for compatibility. From d3aad237fb5e11bae107033cea6089e106a2574e Mon Sep 17 00:00:00 2001 From: Amit Singh Date: Mon, 22 May 2023 10:48:27 +0530 Subject: [PATCH 4/5] version + changelog --- README.md | 2 +- changelog.txt | 4 +-- composer.json | 2 +- languages/ocean-social-sharing.pot | 52 +++++++++++++++--------------- ocean-social-sharing.php | 2 +- readme.txt | 6 ++-- 6 files changed, 34 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 24ac002..222e02b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **Contributors:** Nick **Requires at least:** WordPress 5.6 -**Tested up to:** WordPress 6.2 +**Tested up to:** WordPress 6.2.1 **Stable tag:** 2.0.4 **License:** GPLv2 or later **License URI:** https://www.gnu.org/licenses/gpl-2.0.html diff --git a/changelog.txt b/changelog.txt index e02e6f2..2244a7b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,7 @@ == Changelog == -= 2.0.4 - MAY 17 2023 = -- Compatibility: PHP 8.2: Creation of dynamic property Ocean_Social_Sharing::$plugin_path and Ocean_Social_Sharing::$plugin_url is deprecated. += 2.0.4 - MAY 22 2023 = +- Added: Compatibility: PHP 8.2.6: Creation of dynamic property Ocean_Social_Sharing::$plugin_path and Ocean_Social_Sharing::$plugin_url is deprecated. = 2.0.3 - MAR 29 2023 = - Updated: Version numbers for compatibility. diff --git a/composer.json b/composer.json index 3d9e2de..cbedfbe 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ ], "lint:wpcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs", "lint:summary": "@php ./vendor/bin/parallel-lint --exclude .git --exclude vendor --exclude node_modules .", - "make-pot": "wp i18n make-pot . languages/ocean-social-sharing.pot" + "make-pot": "wp i18n make-pot . languages/ocean-social-sharing.pot --exclude=build" }, "config": { diff --git a/languages/ocean-social-sharing.pot b/languages/ocean-social-sharing.pot index a6921c6..7979a88 100644 --- a/languages/ocean-social-sharing.pot +++ b/languages/ocean-social-sharing.pot @@ -9,7 +9,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2023-04-07T05:47:24+00:00\n" +"POT-Creation-Date: 2023-05-22T05:16:52+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.7.1\n" "X-Domain: ocean-social-sharing\n" @@ -34,100 +34,100 @@ msgstr "" msgid "https://oceanwp.org/" msgstr "" -#: ocean-social-sharing.php:242 -#: ocean-social-sharing.php:730 +#: ocean-social-sharing.php:258 +#: ocean-social-sharing.php:746 msgid "Social Sharing" msgstr "" -#: ocean-social-sharing.php:275 +#: ocean-social-sharing.php:291 msgid "Sharing Buttons" msgstr "" -#: ocean-social-sharing.php:312 +#: ocean-social-sharing.php:328 msgid "Position" msgstr "" -#: ocean-social-sharing.php:318 +#: ocean-social-sharing.php:334 msgid "Before the Content" msgstr "" -#: ocean-social-sharing.php:319 +#: ocean-social-sharing.php:335 msgid "After the Content" msgstr "" -#: ocean-social-sharing.php:320 +#: ocean-social-sharing.php:336 msgid "Before & After the Content" msgstr "" -#: ocean-social-sharing.php:321 +#: ocean-social-sharing.php:337 msgid "No Buttons in the Content" msgstr "" -#: ocean-social-sharing.php:344 +#: ocean-social-sharing.php:360 msgid "Add Social Name" msgstr "" -#: ocean-social-sharing.php:359 +#: ocean-social-sharing.php:375 msgid "Please Share This" msgstr "" -#: ocean-social-sharing.php:370 +#: ocean-social-sharing.php:386 msgid "Sharing Heading" msgstr "" -#: ocean-social-sharing.php:396 +#: ocean-social-sharing.php:412 msgid "Heading Position" msgstr "" -#: ocean-social-sharing.php:402 +#: ocean-social-sharing.php:418 msgid "Side" msgstr "" -#: ocean-social-sharing.php:403 +#: ocean-social-sharing.php:419 msgid "Top" msgstr "" -#: ocean-social-sharing.php:425 +#: ocean-social-sharing.php:441 msgid "Twitter Username" msgstr "" -#: ocean-social-sharing.php:449 +#: ocean-social-sharing.php:465 msgid "Styling" msgstr "" -#: ocean-social-sharing.php:473 +#: ocean-social-sharing.php:489 msgid "Style" msgstr "" -#: ocean-social-sharing.php:479 +#: ocean-social-sharing.php:495 msgid "Minimal" msgstr "" -#: ocean-social-sharing.php:480 +#: ocean-social-sharing.php:496 msgid "Colored" msgstr "" -#: ocean-social-sharing.php:481 +#: ocean-social-sharing.php:497 msgid "Dark" msgstr "" -#: ocean-social-sharing.php:503 +#: ocean-social-sharing.php:519 msgid "Border Radius" msgstr "" -#: ocean-social-sharing.php:504 +#: ocean-social-sharing.php:520 msgid "Add a custom border radius. px - em - %." msgstr "" -#: ocean-social-sharing.php:529 +#: ocean-social-sharing.php:545 msgid "Minimal Style: Borders Color" msgstr "" -#: ocean-social-sharing.php:553 +#: ocean-social-sharing.php:569 msgid "Minimal Style: Background Color" msgstr "" -#: ocean-social-sharing.php:577 +#: ocean-social-sharing.php:593 msgid "Minimal Style: Color" msgstr "" diff --git a/ocean-social-sharing.php b/ocean-social-sharing.php index 0391c79..34eaff7 100644 --- a/ocean-social-sharing.php +++ b/ocean-social-sharing.php @@ -7,7 +7,7 @@ * Author: OceanWP * Author URI: https://oceanwp.org/ * Requires at least: 5.6 - * Tested up to: 6.2 + * Tested up to: 6.2.1 * * Text Domain: ocean-social-sharing * Domain Path: /languages diff --git a/readme.txt b/readme.txt index e56e8ee..3fffbba 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: oceanwp, apprimit, wpfleek Tags: social, social sharing, social share, share, oceanwp Requires at least: 5.6 -Tested up to: 6.2 +Tested up to: 6.2.1 Requires PHP: 7.2 Stable tag: 2.0.4 License: GPLv2 or later @@ -56,8 +56,8 @@ This plugin will only function with the [OceanWP](https://oceanwp.org/) theme. == Changelog == -= 2.0.4 - MAY 17 2023 = -- Compatibility: PHP 8.2: Creation of dynamic property Ocean_Social_Sharing::$plugin_path and Ocean_Social_Sharing::$plugin_url is deprecated. += 2.0.4 - MAY 22 2023 = +- Added: Compatibility: PHP 8.2.6: Creation of dynamic property Ocean_Social_Sharing::$plugin_path and Ocean_Social_Sharing::$plugin_url is deprecated. = 2.0.3 - MAR 29 2023 = - Updated: Version numbers for compatibility. From fd27db04d0e2a7698244fb9a00da1f3e26a83c2c Mon Sep 17 00:00:00 2001 From: Amit Singh Date: Wed, 24 May 2023 11:10:49 +0530 Subject: [PATCH 5/5] version + changelog --- README.md | 2 +- changelog.txt | 2 +- ocean-social-sharing.php | 2 +- readme.txt | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 222e02b..b595c69 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **Contributors:** Nick **Requires at least:** WordPress 5.6 -**Tested up to:** WordPress 6.2.1 +**Tested up to:** WordPress 6.2.2 **Stable tag:** 2.0.4 **License:** GPLv2 or later **License URI:** https://www.gnu.org/licenses/gpl-2.0.html diff --git a/changelog.txt b/changelog.txt index 2244a7b..e98124a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,6 @@ == Changelog == -= 2.0.4 - MAY 22 2023 = += 2.0.4 - MAY 23 2023 = - Added: Compatibility: PHP 8.2.6: Creation of dynamic property Ocean_Social_Sharing::$plugin_path and Ocean_Social_Sharing::$plugin_url is deprecated. = 2.0.3 - MAR 29 2023 = diff --git a/ocean-social-sharing.php b/ocean-social-sharing.php index 34eaff7..166aa4b 100644 --- a/ocean-social-sharing.php +++ b/ocean-social-sharing.php @@ -7,7 +7,7 @@ * Author: OceanWP * Author URI: https://oceanwp.org/ * Requires at least: 5.6 - * Tested up to: 6.2.1 + * Tested up to: 6.2.2 * * Text Domain: ocean-social-sharing * Domain Path: /languages diff --git a/readme.txt b/readme.txt index 3fffbba..b38f56a 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: oceanwp, apprimit, wpfleek Tags: social, social sharing, social share, share, oceanwp Requires at least: 5.6 -Tested up to: 6.2.1 +Tested up to: 6.2.2 Requires PHP: 7.2 Stable tag: 2.0.4 License: GPLv2 or later @@ -56,7 +56,7 @@ This plugin will only function with the [OceanWP](https://oceanwp.org/) theme. == Changelog == -= 2.0.4 - MAY 22 2023 = += 2.0.4 - MAY 23 2023 = - Added: Compatibility: PHP 8.2.6: Creation of dynamic property Ocean_Social_Sharing::$plugin_path and Ocean_Social_Sharing::$plugin_url is deprecated. = 2.0.3 - MAR 29 2023 =