78% shariff-sharing

Code Review | Shariff for Wordpress

WordPress plugin Shariff for Wordpress scored78%from 54 tests.

About plugin

  • Plugin page: shariff-sharing
  • Plugin version: 1.0.11
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2
  • WordPress version: 6.3.1
  • First release: Nov 30, 2014
  • Latest release: Apr 23, 2015
  • Number of updates: 22
  • Update frequency: every 6.5 days
  • Top authors: yanniksde (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

2,000+ active /29,623 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.60MB] [CPU: ▼14.15ms] Passed 4 tests

Analyzing server-side resources used by Shariff for Wordpress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.81 ▼1.52
Dashboard /wp-admin3.41 ▲0.1051.69 ▼0.80
Posts /wp-admin/edit.php3.52 ▲0.1651.09 ▼4.73
Add New Post /wp-admin/post-new.php3.25 ▼2.6348.15 ▼46.28
Media Library /wp-admin/upload.php3.33 ▲0.1034.10 ▼4.05
Shariff /wp-admin/options-general.php?page=shariff3.3037.22

Server storage [IO: ▲4.17MB] [DB: ▲0.00MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 622 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Shariff for Wordpress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,960 ▲19913.79 ▼0.9610.50 ▲8.7736.66 ▼6.13
Dashboard /wp-admin2,225 ▲254.85 ▼1.04100.34 ▼12.0239.09 ▼7.19
Posts /wp-admin/edit.php2,104 ▲12.05 ▲0.0835.35 ▼5.5938.65 ▼3.12
Add New Post /wp-admin/post-new.php6,222 ▲4,69119.15 ▼4.08935.69 ▲324.2870.93 ▲12.35
Media Library /wp-admin/upload.php1,404 ▲44.35 ▲0.06101.72 ▼9.5044.74 ▲0.63
Shariff /wp-admin/options-general.php?page=shariff1,0062.1524.5039.90

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/shariff-sharing/shariff-wp.php
  • 378× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Zend\\ServiceManager\\Exception\\RuntimeException' not found in wp-content/plugins/shariff-sharing/backend/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Exception/ServiceNotCreatedException.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Zend\\ServiceManager\\Exception\\RuntimeException' not found in wp-content/plugins/shariff-sharing/backend/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/Exception/InvalidServiceNameException.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\ClientInterface' not found in wp-content/plugins/shariff-sharing/backend/vendor/guzzlehttp/guzzle/src/Client.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/shariff-sharing/backend/vendor/guzzlehttp/guzzle/tests/MimetypesTest.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Zend\\Json\\Exception\\ExceptionInterface' not found in wp-content/plugins/shariff-sharing/backend/vendor/zendframework/zend-json/Zend/Json/Exception/BadMethodCallException.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Zend\\Cache\\Storage\\IteratorInterface' not found in wp-content/plugins/shariff-sharing/backend/vendor/zendframework/zend-cache/Zend/Cache/Storage/Adapter/DbaIterator.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Zend\\ServiceManager\\ServiceLocatorInterface' not found in wp-content/plugins/shariff-sharing/backend/vendor/zendframework/zend-servicemanager/Zend/ServiceManager/ServiceManager.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'React\\Promise\\ExtendedPromiseInterface' not found in wp-content/plugins/shariff-sharing/backend/vendor/react/promise/src/FulfilledPromise.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/shariff-sharing/backend/vendor/guzzlehttp/streams/tests/LimitStreamTest.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Zend\\Config\\Processor\\ProcessorInterface' not found in wp-content/plugins/shariff-sharing/backend/vendor/zendframework/zend-config/Zend/Config/Processor/Filter.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

shariff-sharing/shariff-wp.php 85% from 13 tests

"Shariff for Wordpress" version 1.0.11's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("shariff-sharing.php" instead of "shariff-wp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected50,806 lines of code in 589 files:
LanguageFilesBlank linesComment linesLines of code
PHP5208,20020,54941,246
Markdown1364402,519
CSS20152,114
reStructuredText191,2211,5742,019
SVG2001,085
JSON1100858
make57810333
JavaScript32472228
PO File38185216
YAML417073
XML42071
Python210041
HTML1003

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.90
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity2.15
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces71
Interfaces89
Traits25
Classes410
▷ Abstract classes225.37%
▷ Concrete classes38894.63%
▷ Final classes30.77%
Methods3,505
▷ Static methods1905.42%
▷ Public methods3,05087.02%
▷ Protected methods3409.70%
▷ Private methods1153.28%
Functions434
▷ Named functions4710.83%
▷ Anonymous functions38789.17%
Constants68
▷ Global constants00.00%
▷ Class constants68100.00%
▷ Public constants68100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.37MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
backend/vendor/guzzlehttp/guzzle/docs/_static/logo.png241.87KB69.68KB▼ 71.19%
backend/vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png0.78KB0.94KB0.00%
assets/screenshot-2.png43.29KB12.83KB▼ 70.36%
assets/screenshot-3.png43.79KB13.03KB▼ 70.24%
assets/screenshot-1.png44.33KB12.94KB▼ 70.82%