10% socialshare

Code Review | Social Share

WordPress plugin Social Share scored10%from 54 tests.

About plugin

  • Plugin page: socialshare
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-3.4.1
  • WordPress version: 6.3.1
  • First release: Jul 9, 2012
  • Latest release: Oct 3, 2012
  • Number of updates: 9
  • Update frequency: every 9.7 days
  • Top authors: agnelwaghela (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /7,058 total downloads

Benchmarks

Plugin footprint 40% 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 cannot be installed
    • > Deprecated in wp-content/plugins/socialshare/plugin.php+240
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼54.69ms] Passed 4 tests

A check of server-side resources used by Social Share
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.445.28 ▼36.16
Dashboard /wp-admin2.05 ▼1.265.97 ▼45.17
Posts /wp-admin/edit.php2.05 ▼1.316.33 ▼44.31
Add New Post /wp-admin/post-new.php2.05 ▼3.845.43 ▼93.10
Media Library /wp-admin/upload.php2.05 ▼1.186.12 ▼31.17

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_socialshare
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Social Share
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.57 ▼0.712.13 ▼0.1645.33 ▲0.26
Dashboard /wp-admin2,211 ▲234.85 ▼1.06104.45 ▼11.3440.61 ▼3.31
Posts /wp-admin/edit.php2,091 ▼12.00 ▼0.1238.05 ▼3.8134.17 ▼4.44
Add New Post /wp-admin/post-new.php1,516 ▼317.38 ▼5.74691.19 ▲22.4158.82 ▲6.82
Media Library /wp-admin/upload.php1,393 ▲54.10 ▼0.11109.10 ▼7.5647.18 ▼3.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/socialshare/plugin.php+240
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_socialshare
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means 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
Please fix the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/socialshare/views/widget.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/socialshare/views/admin.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/socialshare/plugin.php:29
    • > PHP Notice
      Undefined variable: twitterurl in wp-content/plugins/socialshare/views/widget.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (the Widget [Full Image](http://www.dropbox.com/s/is6xcywet3x5euz/screenshot-1.png))
The official readme.txt might help

socialshare/plugin.php 92% from 13 tests

Analyzing the main PHP file in "Social Share" version 1.0
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("socialshare.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin201 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP363102165
CSS21536

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods457.14%
▷ Protected methods00.00%
▷ Private methods342.86%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.71MB with 0.37MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/share-pinterest.png8.26KB3.98KB▼ 51.82%
screenshot-1.png693.55KB239.51KB▼ 65.47%
images/share-facebook.png5.75KB3.28KB▼ 42.93%
images/share-googleplus.png8.91KB4.84KB▼ 45.74%
images/share-twitter.png8.81KB4.15KB▼ 52.83%