94% advanced-posts-widget

Code Review | Advanced Posts Widget

WordPress plugin Advanced Posts Widget scored 94% from 54 tests.

About plugin

  • Plugin page: advanced-posts-wi...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.5
  • WordPress version: 5.9.2
  • First release: Apr 12, 2016
  • Latest release: Apr 12, 2016
  • Number of updates: 8
  • Update frequency: every 1.4 days
  • Top authors: dbmartin (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

700+ active / 6,286 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.22MB] [CPU: ▼306.37ms] Passed 4 tests

Server-side resources used by Advanced Posts Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.2856.58 ▲1.70
Dashboard /wp-admin3.63 ▲0.2236.50 ▼2.90
Posts /wp-admin/edit.php3.86 ▲0.2139.88 ▲3.70
Add New Post /wp-admin/post-new.php7.16 ▲0.1996.09 ▼1,225.20
Media Library /wp-admin/upload.php3.57 ▲0.2726.88 ▲0.91

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 20 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Posts Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,783 ▲6115.98 ▲0.017.42 ▲1.382.59 ▲0.28
Dashboard /wp-admin2,883 ▲256.14 ▼0.10116.18 ▼17.10157.09 ▼5.97
Posts /wp-admin/edit.php2,690 ▼43.23 ▼0.0164.67 ▲1.14134.68 ▼7.41
Add New Post /wp-admin/post-new.php1,760 ▲9921.41 ▲5.41450.25 ▲17.98159.96 ▲5.75
Media Library /wp-admin/upload.php1,700 ▲25.53 ▲0.04140.32 ▼15.68182.00 ▼8.19

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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 take a closer look at the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/advanced-posts-widget/tpl/content-html5.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/advanced-posts-widget/tpl/content-xhtml.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Advanced_Posts_Widget_Fields' not found in wp-content/plugins/advanced-posts-widget/inc/widget-form.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: recent-posts, posts, widget, posts-widget, recent posts

advanced-posts-widget/apw.php 92% from 13 tests

The entry point to "Advanced Posts Widget" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-posts-widget.php" instead of "apw.php")

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
No dangerous file extensions were detected1,727 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP105421,0331,381
CSS2361193
JavaScript1321196
Markdown136057

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity29.00
▷ Minimum class complexity16.00
▷ Maximum class complexity65.00
Average method complexity3.03
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods69
▷ Static methods5173.91%
▷ Public methods69100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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 images were found in this plugin