10% akfeatured-post-widget

Code Review | AK Featured Post Widget

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

About plugin

  • Plugin page: akfeatured-post-w...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.3-4.5.3
  • WordPress version: 6.3.1
  • First release: Apr 19, 2012
  • Latest release: Jul 17, 2016
  • Number of updates: 31
  • Update frequency: every 50.0 days
  • Top authors: kaser (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /39,421 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
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/akfeatured-post-widget/ak_featured_post.php+353
    Function create_function() is deprecated

Server metrics [RAM: ▼1.78MB] [CPU: ▼54.18ms] Passed 4 tests

A check of server-side resources used by AK Featured Post Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.20 ▼1.264.84 ▼36.21
Dashboard /wp-admin2.22 ▼1.087.24 ▼41.87
Posts /wp-admin/edit.php2.22 ▼1.137.09 ▼41.69
Add New Post /wp-admin/post-new.php2.22 ▼3.667.04 ▼96.94
Media Library /wp-admin/upload.php2.22 ▼1.005.37 ▼30.10

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_ak_featured_post_widget
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for AK Featured Post Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.081.72 ▼0.1543.75 ▼0.92
Dashboard /wp-admin2,206 ▲185.74 ▲0.84102.59 ▼9.2640.50 ▼9.08
Posts /wp-admin/edit.php2,089 ▼32.02 ▲0.0139.56 ▼1.2133.18 ▼2.91
Add New Post /wp-admin/post-new.php1,514 ▼2817.63 ▼5.75682.64 ▲5.0351.72 ▼2.03
Media Library /wp-admin/upload.php1,391 ▲34.20 ▼0.0299.79 ▼7.5046.98 ▲1.62

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
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/akfeatured-post-widget/ak_featured_post.php+353
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_ak_featured_post_widget
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/akfeatured-post-widget/ak_featured_post.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
You can take inspiration from this readme.txt

akfeatured-post-widget/ak_featured_post.php 85% from 13 tests

The main PHP script in "AK Featured Post Widget" version 2.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("akfeatured-post-widget.php" instead of "ak_featured_post.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 211 characters long)

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 detected303 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP13837279
JavaScript12324

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity55.00
▷ Minimum class complexity55.00
▷ Maximum class complexity55.00
Average method complexity11.80
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.12MB with 0.09MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Screenshot-1.png62.07KB16.91KB▼ 72.75%
Screenshot-2.png61.03KB17.71KB▼ 70.98%