10% socializr

Code Review | Socializr

WordPress plugin Socializr scored 10% from 54 tests.

About plugin

  • Plugin page: socializr
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.2.2
  • WordPress version: 6.3.1
  • First release: Jun 19, 2015
  • Latest release: Jun 19, 2015
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: bigbitecreative (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 678 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Compile error in wp-content/plugins/socializr/vendor/vierbergenlars/php-semver/src/vierbergenlars/SemVer/internal.php+7
    Cannot use vierbergenlars\LibJs\Object as Object because 'Object' is a special class name

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.12ms] Passed 4 tests

A check of server-side resources used by Socializr
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0046.59 ▲5.66
Dashboard /wp-admin3.31 ▲0.0143.42 ▼6.99
Posts /wp-admin/edit.php3.36 ▲0.0047.37 ▼0.50
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.33 ▼14.87
Media Library /wp-admin/upload.php3.23 ▲0.0034.43 ▲1.87

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 3,318 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Socializr
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.23 ▼1.141.96 ▲0.2843.44 ▲1.52
Dashboard /wp-admin2,206 ▲344.84 ▼0.11108.41 ▼6.2740.54 ▼2.92
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0540.13 ▲7.2434.88 ▲0.09
Add New Post /wp-admin/post-new.php1,534 ▲2023.03 ▲5.29642.12 ▼36.8157.24 ▲6.07
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.0497.50 ▼0.8241.48 ▼1.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1488× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\HttpFoundation\\Session\\SessionBagInterface' not found in wp-content/plugins/socializr/trunk/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpKernel\\Exception\\HttpException' not found in wp-content/plugins/socializr/trunk/vendor/symfony/http-kernel/Exception/NotFoundHttpException.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_FunctionInterface' not found in wp-content/plugins/socializr/vendor/twig/twig/lib/Twig/Function.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\EventDispatcher\\EventSubscriberInterface' not found in wp-content/plugins/socializr/trunk/vendor/symfony/http-kernel/EventListener/ProfilerListener.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/socializr/vendor/symfony/debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Test' not found in wp-content/plugins/socializr/trunk/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/socializr/vendor/symfony/translation/Tests/Dumper/CsvFileDumperTest.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\EventDispatcher\\EventSubscriberInterface' not found in wp-content/plugins/socializr/trunk/vendor/symfony/http-kernel/EventListener/LocaleListener.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpKernel\\DataCollector\\DataCollector' not found in wp-content/plugins/socializr/trunk/vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\HttpKernel\\Profiler\\ProfilerStorageInterface' not found in wp-content/plugins/socializr/trunk/vendor/symfony/http-kernel/Profiler/RedisProfilerStorage.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: links, sharing, social

socializr/plugin.php 92% from 13 tests

This is the main PHP file of "Socializr" version 1.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("socializr.php" instead of "plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin79,928 lines of code in 1,331 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,11917,78847,67968,227
reStructuredText882,2141,9883,043
XSD252282,452
Markdown2471701,947
JSON25001,943
C22091691,004
Twig18570505
XML20290434
CSS118098
YAML915374
C/C++ Header2192155
m42131246
JavaScript112043
PO File55029
HTML110017
Qt Linguist10010
INI1001

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 154)
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity6.96
▷ Minimum class complexity1.00
▷ Maximum class complexity185.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity154.00
Code structure
Namespaces177
Interfaces284
Traits16
Classes1,834
▷ Abstract classes1085.89%
▷ Concrete classes1,72694.11%
▷ Final classes20.12%
Methods13,800
▷ Static methods9506.88%
▷ Public methods11,30281.90%
▷ Protected methods2,11415.32%
▷ Private methods3842.78%
Functions870
▷ Named functions30635.17%
▷ Anonymous functions56464.83%
Constants624
▷ Global constants9615.38%
▷ Class constants52884.62%
▷ Public constants528100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.35MB with 0.25MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
trunk/resources/assets/socializr-logo.png19.59KB0.74KB▼ 96.23%
resources/assets/icon.png161.45KB88.43KB▼ 45.23%
resources/assets/socializr-logo.png19.59KB0.74KB▼ 96.23%
trunk/resources/assets/icon.png161.45KB88.43KB▼ 45.23%