84% popular-post-widget-with-thumbnail

Code Review | Popular Post Widget with Thumbnail

WordPress plugin Popular Post Widget with Thumbnail scored 84% from 53 tests.

About plugin

  • Plugin page: popular-post-widg...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.7
  • WordPress version: 5.8.1
  • First release: Aug 8, 2018
  • Latest release: Aug 8, 2018
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: ikamal (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 503 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼253.93ms] Passed 4 tests

An overview of server-side resources used by Popular Post Widget with Thumbnail
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1532.10 ▲9.61
Dashboard /wp-admin3.09 ▲0.0443.78 ▼2.68
Posts /wp-admin/edit.php3.14 ▲0.0344.97 ▲0.24
Add New Post /wp-admin/post-new.php5.45 ▲0.0290.71 ▼1,008.17
Media Library /wp-admin/upload.php3.03 ▲0.0234.16 ▼5.12

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 1 new option
New WordPress options
widget_popularpost

Browser metrics Passed 4 tests

A check of browser resources used by Popular Post Widget with Thumbnail
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,676 ▲7015.87 ▲0.398.10 ▼0.5651.84 ▲4.87
Dashboard /wp-admin2,933 ▲806.09 ▲0.27157.53 ▲25.74104.63 ▲5.88
Posts /wp-admin/edit.php2,703 ▼32.69 ▲0.0061.59 ▼6.3592.81 ▼3.37
Add New Post /wp-admin/post-new.php1,853 ▼018.93 ▼0.18365.94 ▼28.54110.83 ▼3.10
Media Library /wp-admin/upload.php1,772 ▲565.01 ▲0.03143.21 ▼20.57114.56 ▼1.35

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_popularpost

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 | 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 take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/popular-post-widget-with-thumbnail/bootstrap.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/popular-post-widget-with-thumbnail/popular-post-widget.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/popular-post-widget-with-thumbnail/popular-post.php:2

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: popular post widget, popular post, popular posts, most popular posts, widget

popular-post-widget-with-thumbnail/popular-post-widget.php 85% from 13 tests

The main PHP file in "Popular Post Widget with Thumbnail" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • 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
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("popular-post-widget-with-thumbnail.php" instead of "popular-post-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
Everything looks great! No dangerous files found in this plugin174 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP44567123
PO File15527
CSS13024

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.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 functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.10MB with 0.07MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/Screenshot-1.png106.20KB36.62KB▼ 65.52%