10% advanced-featured-post-widget

Code Review | Advanced Featured Post Widget

WordPress plugin Advanced Featured Post Widget scored10%from 54 tests.

About plugin

  • Plugin page: advanced-featured...
  • Plugin version: 3.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-4.5
  • WordPress version: 6.3.1
  • First release: Mar 4, 2011
  • Latest release: Apr 9, 2016
  • Number of updates: 72
  • Update frequency: every 25.9 days
  • Top authors: tepelstreel (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

300+ active /41,300 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/advanced-featured-post-widget/class-lib/AFPW_WidgetClass.php+446
    Function create_function() is deprecated

Server metrics [RAM: ▼1.39MB] [CPU: ▼51.22ms] Passed 4 tests

A check of server-side resources used by Advanced Featured Post Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.59 ▼0.878.50 ▼34.96
Dashboard /wp-admin2.61 ▼0.699.68 ▼46.79
Posts /wp-admin/edit.php2.61 ▼0.7412.04 ▼38.98
Add New Post /wp-admin/post-new.php2.61 ▼3.2710.62 ▼84.13
Media Library /wp-admin/upload.php2.61 ▼0.6112.54 ▼26.71
Advanced Featured Post Widget /wp-admin/options-general.php?page=advanced-fpw-settings2.6212.62

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
afpw_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_advanced_featured_post_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Featured Post Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲3514.11 ▼0.421.90 ▲0.1241.60 ▼9.43
Dashboard /wp-admin2,214 ▲345.57 ▼0.0885.95 ▼1.0173.50 ▲31.82
Posts /wp-admin/edit.php2,122 ▲221.95 ▼0.0838.87 ▼2.6035.78 ▲0.08
Add New Post /wp-admin/post-new.php1,698 ▲17222.23 ▼1.01765.18 ▲62.7258.51 ▲2.13
Media Library /wp-admin/upload.php1,416 ▲164.23 ▼0.05128.98 ▲10.9582.74 ▲34.70
Advanced Featured Post Widget /wp-admin/options-general.php?page=advanced-fpw-settings1,0894.7260.9958.55

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/advanced-featured-post-widget/class-lib/AFPW_WidgetClass.php+446
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_advanced_featured_post_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=advanced-fpw-settings
    • > Deprecated in wp-content/plugins/advanced-featured-post-widget/class-lib/AFPW_WidgetClass.php+446
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=advanced-fpw-settings
    • > Notice in wp-content/plugins/advanced-featured-post-widget/class-lib/AFPW_AdminClass.php+158
    Undefined index: link
    • > GET request to /wp-admin/options-general.php?page=advanced-fpw-settings
    • > Notice in wp-content/plugins/advanced-featured-post-widget/class-lib/AFPW_AdminClass.php+164
    Undefined index: hover

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'A5_OptionPage' not found in wp-content/plugins/advanced-featured-post-widget/class-lib/AFPW_AdminClass.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/advanced-featured-post-widget/class-lib/A5_WidgetClass.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'A5_DynamicFiles' not found in wp-content/plugins/advanced-featured-post-widget/class-lib/AFPW_DynamicCSSClass.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'A5_Widget' not found in wp-content/plugins/advanced-featured-post-widget/class-lib/AFPW_WidgetClass.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=advanced-fpw-settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/advanced-featured-post-widget/ta-expander.js?ver=3.0:236:27)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=advanced-fpw-settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 90% 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
8 plugin tags: featured, post, sidebar, newspaper, feature...

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

The main PHP file in "Advanced Featured Post Widget" ver. 3.5.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • 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: The principal plugin file should be the same as the plugin slug ("advanced-featured-post-widget.php" instead of "advanced-fpw.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 357 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin2,819 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP101,4455291,831
PO File3248260814
JavaScript26919174

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity31.00
▷ Minimum class complexity10.00
▷ Maximum class complexity76.00
Average method complexity4.16
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods95
▷ Static methods3637.89%
▷ Public methods8690.53%
▷ Protected methods00.00%
▷ Private methods99.47%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants240.00%
▷ Class constants360.00%
▷ Public constants3100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/a5-icon-11.png0.67KB0.42KB▼ 37.17%
img/a5-icon-34.png1.65KB1.35KB▼ 18.07%