83% social-media-share-and-widget

Code Review | Social Media Share & Widget

WordPress plugin Social Media Share & Widget scored83%from 54 tests.

About plugin

  • Plugin page: social-media-shar...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.2
  • WordPress version: 6.3.1
  • First release: Aug 30, 2019
  • Latest release: Oct 24, 2019
  • Number of updates: 3
  • Update frequency: every 18.3 days
  • Top authors: istiaqnirab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /711 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▲3.40ms] Passed 4 tests

Server-side resources used by Social Media Share & Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0954.99 ▲11.05
Dashboard /wp-admin3.40 ▲0.0954.83 ▲2.08
Posts /wp-admin/edit.php3.45 ▲0.0955.40 ▲9.72
Add New Post /wp-admin/post-new.php5.98 ▲0.0988.17 ▲0.19
Media Library /wp-admin/upload.php3.32 ▲0.0939.50 ▲1.62

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_codenrx_social_share_widget
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Social Media Share & Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.27 ▼0.292.04 ▲0.1842.85 ▼3.85
Dashboard /wp-admin2,195 ▲155.53 ▼0.1585.38 ▼3.3240.18 ▼1.04
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0236.03 ▲0.4531.96 ▲0.11
Add New Post /wp-admin/post-new.php1,526 ▼223.15 ▼0.08658.22 ▲12.4261.79 ▲5.81
Media Library /wp-admin/upload.php1,400 ▲94.21 ▼0.06103.90 ▲0.3746.68 ▼1.60

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_codenrx_social_share_widget
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/social-media-share-and-widget/widgets/social_links.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/social-media-share-and-widget/widgets/social_links.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: There are too many tags (17 tag instead of maximum 10)
The official readme.txt might help

social-media-share-and-widget/index.php 77% from 13 tests

"Social Media Share & Widget" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 165 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("social-media-share-and-widget.php" instead of "index.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected733 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
CSS2224389
PHP66935344

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity33.00
▷ Minimum class complexity33.00
▷ Maximum class complexity33.00
Average method complexity9.00
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected