84% cits-social-page-widget-like-box

Code Review | CITS Social Page Widget

WordPress plugin CITS Social Page Widget scored84%from 54 tests.

About plugin

  • Plugin page: cits-social-page-...
  • Plugin version: 2.2.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 15, 2021
  • Latest release: Aug 14, 2023
  • Number of updates: 14
  • Update frequency: every 60.8 days
  • Top authors: ashikcse (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /387 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.63ms] Passed 4 tests

Analyzing server-side resources used by CITS Social Page Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.95 ▼9.07
Dashboard /wp-admin3.32 ▲0.0144.42 ▼4.57
Posts /wp-admin/edit.php3.37 ▲0.0145.31 ▼0.37
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.56 ▼13.69
Media Library /wp-admin/upload.php3.24 ▲0.0133.59 ▼3.19

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_cits_social_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for CITS Social Page Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.161.69 ▼0.3048.10 ▲2.56
Dashboard /wp-admin2,206 ▲154.86 ▼0.01106.79 ▼8.9137.67 ▼5.25
Posts /wp-admin/edit.php2,089 ▼32.01 ▲0.0240.20 ▲4.4733.96 ▲0.83
Add New Post /wp-admin/post-new.php1,533 ▲1923.39 ▲5.92639.65 ▼31.4147.66 ▼22.20
Media Library /wp-admin/upload.php1,385 ▼34.25 ▼0.0694.49 ▼3.2841.56 ▼0.72

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_cits_social_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • 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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cits-social-page-widget-like-box/init.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: cits social page widget, social page widget

cits-social-page-widget-like-box/init.php 85% from 13 tests

This is the main PHP file of "CITS Social Page Widget" version 2.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cits-social-page-widget-like-box.php" instead of "init.php")
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.7" instead of "5.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin126 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21916126

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity13.00
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.13MB with 0.09MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png136.22KB44.19KB▼ 67.56%