83% advanced-post-widget

Code Review | Advanced Post Widget

WordPress plugin Advanced Post Widget scored 83% from 54 tests.

About plugin

  • Plugin page: advanced-post-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.4.2
  • WordPress version: 5.9.2
  • First release: Apr 6, 2016
  • Latest release: Apr 3, 2016
  • Number of updates: 4
  • Update frequency: every 61.5 days
  • Top authors: mrkindy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 891 total downloads


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.90MB] [CPU: ▼311.77ms] Passed 4 tests

Analyzing server-side resources used by Advanced Post Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0558.47 ▲8.67
Dashboard /wp-admin3.45 ▲0.0434.68 ▲0.52
Posts /wp-admin/edit.php3.68 ▲0.0440.01 ▲2.04
Add New Post /wp-admin/post-new.php3.27 ▼3.7328.29 ▼1,249.15
Media Library /wp-admin/upload.php3.33 ▲0.0424.81 ▼0.47

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Post Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,797 ▲5216.27 ▲0.576.53 ▲0.072.78 ▲0.67
Dashboard /wp-admin2,895 ▲346.02 ▼0.17123.08 ▼18.32166.47 ▲4.96
Posts /wp-admin/edit.php2,688 ▼03.24 ▲0.0166.97 ▲2.73146.14 ▲2.41
Add New Post /wp-admin/post-new.php1,722 ▲6119.98 ▲4.36395.75 ▼19.15166.73 ▲8.64
Media Library /wp-admin/upload.php1,698 ▼35.48 ▼0.05144.63 ▲10.21188.61 ▼0.12

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_kindy_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | 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 items
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_permalink() in wp-content/plugins/advanced-post-widget/template/widget_6.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/advanced-post-widget/kindy_widget.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_permalink() in wp-content/plugins/advanced-post-widget/template/widget_1.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_permalink() in wp-content/plugins/advanced-post-widget/template/widget_2.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_permalink() in wp-content/plugins/advanced-post-widget/template/widget_3.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_permalink() in wp-content/plugins/advanced-post-widget/template/widget_4.php:43
    • > PHP Notice
      Undefined variable: c in wp-content/plugins/advanced-post-widget/template/widget_1.php on line 43

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


Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
The official readme.txt is a good inspiration

advanced-post-widget/kindy_widget.php 77% from 13 tests

The principal PHP file in "Advanced Post Widget" v. 1.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-post-widget.php" instead of "kindy_widget.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
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin470 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions5100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin