10% advanced-featured-post-widget

Code Review | Advanced Featured Post Widget

WordPress plugin Advanced Featured Post Widget scored 10% 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: 5.9.2
  • 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

500+ active / 40,291 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • The plugin did not install without 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.84MB] [CPU: ▼337.39ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Featured Post Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.47 ▼0.656.89 ▼11.94
Dashboard /wp-admin2.49 ▼0.925.94 ▼33.35
Posts /wp-admin/edit.php2.49 ▼1.156.06 ▼35.52
Add New Post /wp-admin/post-new.php2.49 ▼4.485.94 ▼1,258.70
Media Library /wp-admin/upload.php2.49 ▼0.817.54 ▼21.98
Advanced Featured Post Widget /wp-admin/options-general.php?page=advanced-fpw-settings2.496.46

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, 2 new options
New WordPress options
widget_advanced_featured_post_widget
afpw_options

Browser metrics Passed 4 tests

Advanced Featured Post Widget: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,821 ▲6715.91 ▲0.316.07 ▼0.2816.83 ▲14.26
Dashboard /wp-admin2,898 ▲436.13 ▼0.05120.47 ▼25.39184.26 ▼20.12
Posts /wp-admin/edit.php2,712 ▲243.24 ▼0.0070.23 ▲3.76150.25 ▲4.35
Add New Post /wp-admin/post-new.php1,764 ▲7420.91 ▼0.02423.89 ▲7.14208.85 ▲16.39
Media Library /wp-admin/upload.php1,721 ▲235.60 ▲0.05129.43 ▼24.05237.22 ▲13.84
Advanced Featured Post Widget /wp-admin/options-general.php?page=advanced-fpw-settings1,4064.2380.58126.39

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
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/advanced-featured-post-widget/class-lib/AFPW_WidgetClass.php+446
    Function create_function() is deprecated
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_advanced_featured_post_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
Almost there! Just fix the following items
  • 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 'A5_DynamicFiles' not found in wp-content/plugins/advanced-featured-post-widget/class-lib/AFPW_DynamicCSSClass.php:13
    • > 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_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 | This is just a short smoke test looking for browser issues
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=5.9.2 1:31592 "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=5.9.2:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.9.2:2:30340)" 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=5.9.2 1:31702 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: featured, image, widget, sidebar, feature...

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

This is the main PHP file of "Advanced Featured Post Widget" version 3.5.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("advanced-featured-post-widget.php" instead of "advanced-fpw.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 357 characters long)

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
Good job! No executable or dangerous file extensions detected2,819 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP101,4455291,831
PO File3248260814
JavaScript26919174

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
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

Often times overlooked, PNG files can occupy unnecessary space in 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-34.png1.65KB1.35KB▼ 18.07%
img/a5-icon-11.png0.67KB0.42KB▼ 37.17%