83% themes4wp-social-counter-widget

Code Review | Themes4WP Social Counter Widget

WordPress plugin Themes4WP Social Counter Widget scored83%from 54 tests.

About plugin

  • Plugin page: themes4wp-social-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4
  • WordPress version: 6.3.1
  • First release: Feb 9, 2016
  • Latest release: Feb 9, 2016
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: themes4wp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /3,878 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.12MB] [CPU: ▼2.87ms] Passed 4 tests

An overview of server-side resources used by Themes4WP Social Counter Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1238.72 ▼3.21
Dashboard /wp-admin3.43 ▲0.1244.46 ▼8.28
Posts /wp-admin/edit.php3.54 ▲0.1847.13 ▼1.40
Add New Post /wp-admin/post-new.php6.01 ▲0.1297.30 ▲7.27
Media Library /wp-admin/upload.php3.35 ▲0.1235.90 ▲1.41

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Themes4WP Social Counter Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5714.55 ▲0.1738.36 ▲36.2042.19 ▼5.52
Dashboard /wp-admin2,209 ▲214.89 ▲0.01110.35 ▼6.2844.64 ▼1.23
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0440.82 ▲4.2535.18 ▲1.02
Add New Post /wp-admin/post-new.php1,532 ▼1023.12 ▲4.73581.98 ▼53.2250.79 ▼21.42
Media Library /wp-admin/upload.php1,391 ▲34.21 ▼0.0993.56 ▼8.0640.69 ▼2.85

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_twp_social
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/themes4wp-social-counter-widget/twp-social-counter-widget.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 31 tag instead of maximum 10
Please take inspiration from this readme.txt

themes4wp-social-counter-widget/twp-social-counter-widget.php 85% from 13 tests

The main PHP file in "Themes4WP Social Counter Widget" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 163 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("themes4wp-social-counter-widget.php" instead of "twp-social-counter-widget.php")

Code Analysis Passed 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 plugin695 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP384141540
CSS144155

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity37.00
▷ Minimum class complexity30.00
▷ Maximum class complexity44.00
Average method complexity5.80
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods1386.67%
▷ Protected methods00.00%
▷ Private methods213.33%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.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
6 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/post-icon.png0.62KB0.46KB▼ 26.26%
images/facebook-icon.png1.06KB0.22KB▼ 79.04%
images/comments-icon.png0.64KB0.46KB▼ 28.55%
images/rss-icon.png3.67KB0.83KB▼ 77.48%
images/google-icon.png0.65KB0.45KB▼ 30.18%