84% any-posts-widget

Code Review | Any Posts Widget

WordPress plugin Any Posts Widget scored84%from 54 tests.

About plugin

  • Plugin page: any-posts-widget
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Feb 23, 2017
  • Latest release: Feb 24, 2017
  • Number of updates: 10
  • Update frequency: every 11.1 days
  • Top authors: truongwp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /993 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼7.06ms] Passed 4 tests

Analyzing server-side resources used by Any Posts Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0434.76 ▼6.16
Dashboard /wp-admin3.35 ▼0.0044.41 ▼14.71
Posts /wp-admin/edit.php3.40 ▲0.0444.99 ▼2.39
Add New Post /wp-admin/post-new.php5.93 ▲0.0488.01 ▼4.96
Media Library /wp-admin/upload.php3.27 ▲0.0435.24 ▼0.08

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_any-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Any Posts Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5613.21 ▼1.381.77 ▼0.1637.30 ▼8.67
Dashboard /wp-admin2,206 ▲184.85 ▼1.0594.92 ▼13.3038.62 ▼4.12
Posts /wp-admin/edit.php2,089 ▼32.05 ▲0.0640.25 ▼2.5735.94 ▼1.29
Add New Post /wp-admin/post-new.php1,533 ▼023.28 ▼0.12672.43 ▲20.7653.12 ▼3.84
Media Library /wp-admin/upload.php1,391 ▲64.25 ▼0.1697.77 ▼2.0141.11 ▼5.30

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_any-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/any-posts-widget/inc/class-apw-widget.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function post_class() in wp-content/plugins/any-posts-widget/templates/loop.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Widget options), #2 (Example with Twenty Sixteen theme)
You can look at the official readme.txt

any-posts-widget/any-posts-widget.php Passed 13 tests

The primary PHP file in "Any Posts Widget" version 1.0.1 is used by WordPress to initiate all plugin functionality
57 characters long description:
Provides a widget allow choosing posts to display easily.

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
There were no executable files found in this plugin276 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP459122186
CSS29055
JavaScript110035

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.00
▷ Minimum class complexity2.00
▷ Maximum class complexity12.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods8
▷ Static methods112.50%
▷ Public methods787.50%
▷ Protected methods00.00%
▷ Private methods112.50%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png28.02KB9.61KB▼ 65.72%
screenshot-1.png18.27KB7.23KB▼ 60.43%