84% advanced-posts-widget

Code Review | Advanced Posts Widget

WordPress plugin Advanced Posts Widget scored84%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: 6.3.1
  • 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

500+ active /6,631 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.92ms] Passed 4 tests

Analyzing server-side resources used by Advanced Posts Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.64 ▼4.67
Dashboard /wp-admin3.32 ▲0.0257.03 ▲2.17
Posts /wp-admin/edit.php3.38 ▲0.0254.24 ▲1.03
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.07 ▼6.21
Media Library /wp-admin/upload.php3.25 ▲0.0241.95 ▲6.54

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Posts Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.35 ▲0.111.73 ▲0.1343.37 ▲5.44
Dashboard /wp-admin2,197 ▲175.61 ▼0.0383.02 ▼4.6437.56 ▼8.82
Posts /wp-admin/edit.php2,102 ▲22.02 ▼0.0135.78 ▼3.4232.82 ▼10.98
Add New Post /wp-admin/post-new.php1,530 ▲223.11 ▼0.18703.03 ▲5.2353.54 ▼2.30
Media Library /wp-admin/upload.php1,402 ▲24.24 ▲0.02109.68 ▲7.9147.07 ▼4.49

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 detected upon uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_advanced-posts-widget
    • db_upgraded
    • widget_recent-comments

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
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > 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: Class 'Advanced_Posts_Widget_Fields' not found in wp-content/plugins/advanced-posts-widget/inc/widget-form.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/advanced-posts-widget/tpl/content-xhtml.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: widget, posts, posts-widget, recent posts, recent-posts

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

The main file in "Advanced Posts Widget" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Name the main plugin file the same 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 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions 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 short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin