84% ac-simple-post-widget

Code Review | AC Simple Post Widget

WordPress plugin AC Simple Post Widget scored 84% from 53 tests.

About plugin

  • Plugin page: ac-simple-post-wi...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3.1
  • WordPress version: 5.8.1
  • First release: Sep 19, 2015
  • Latest release: Sep 19, 2015
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: aaron_carmen (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 898 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.00MB] [CPU: ▼933.37ms] Passed 4 tests

This is a short check of server-side resources used by AC Simple Post Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.74 ▼0.1018.58 ▼11.87
Dashboard /wp-admin3.08 ▲0.0342.31 ▲0.70
Posts /wp-admin/edit.php3.14 ▲0.0333.19 ▼6.68
Add New Post /wp-admin/post-new.php5.46 ▲0.141,368.31 ▼3,715.61
Media Library /wp-admin/upload.php3.03 ▲0.0336.16 ▲6.65

Server storage [IO: ▲0.03MB] [DB: ▲0.71MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, 1 new option
New WordPress options
widget_ac_simple_post_widget

Browser metrics Passed 4 tests

A check of browser resources used by AC Simple Post Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,651 ▲4516.03 ▲0.4812.39 ▲5.1549.13 ▲0.70
Dashboard /wp-admin2,927 ▲745.92 ▼0.02147.51 ▲12.93145.84 ▲52.57
Posts /wp-admin/edit.php2,695 ▼112.59 ▼0.1061.84 ▼4.3192.17 ▲1.42
Add New Post /wp-admin/post-new.php1,658 ▼19318.53 ▲1.19410.11 ▲45.92124.81 ▲17.36
Media Library /wp-admin/upload.php1,701 ▼745.00 ▼0.01181.06 ▲42.36126.05 ▲17.76

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_ac_simple_post_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/ac-simple-post-widget/acsimplepostwidget.php on line 19
    • > PHP Notice
      Undefined variable: before_widget in wp-content/plugins/ac-simple-post-widget/inc/front-end.php on line 3
    • > PHP Notice
      Undefined variable: img_width in wp-content/plugins/ac-simple-post-widget/inc/front-end.php on line 13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ac-simple-post-widget/inc/widget-fields.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/ac-simple-post-widget/inc/options-page-wrapper.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/ac-simple-post-widget/inc/front-end.php:22
    • > PHP Notice
      Undefined variable: img_height in wp-content/plugins/ac-simple-post-widget/inc/front-end.php on line 14
    • > PHP Notice
      Undefined variable: num_post in wp-content/plugins/ac-simple-post-widget/inc/front-end.php on line 18
    • > PHP Notice
      Undefined variable: post_type in wp-content/plugins/ac-simple-post-widget/inc/front-end.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ac-simple-post-widget/acsimplepostwidget.php:84

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Donate link: Please fix this invalid url: ""
The official readme.txt is a good inspiration

ac-simple-post-widget/acsimplepostwidget.php 92% from 13 tests

The primary PHP file in "AC Simple Post Widget" version 1.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ac-simple-post-widget.php" instead of "acsimplepostwidget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected560 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP414078227
XML500186
Sass111078
CSS211969

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin