83% envy-custom-post-widget

Code Review | Envy Custom Post Widget WordPress Plugin

WordPress plugin Envy Custom Post Widget WordPress Plugin scored83%from 54 tests.

About plugin

  • Plugin page: envy-custom-post-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.7
  • WordPress version: 6.3.1
  • First release: Jan 27, 2021
  • Latest release: Mar 14, 2021
  • Number of updates: 5
  • Update frequency: every 9.6 days
  • Top authors: envytheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /599 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.81ms] Passed 4 tests

Server-side resources used by Envy Custom Post Widget WordPress Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0543.65 ▲2.13
Dashboard /wp-admin3.34 ▲0.0443.38 ▼5.83
Posts /wp-admin/edit.php3.45 ▲0.1046.48 ▼3.29
Add New Post /wp-admin/post-new.php5.92 ▲0.0392.51 ▼3.95
Media Library /wp-admin/upload.php3.26 ▲0.0336.37 ▼2.15

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 36 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
widget_envy_popular_post_widget_callback
widget_envy_recent_post_widget_callback
widget_envy_related_post_widget_callback

Browser metrics Passed 4 tests

This is an overview of browser requirements for Envy Custom Post Widget WordPress Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,885 ▲15013.97 ▼0.328.18 ▲6.4239.37 ▼0.92
Dashboard /wp-admin2,209 ▲185.86 ▲0.97101.71 ▼5.6537.71 ▼3.43
Posts /wp-admin/edit.php2,101 ▲92.23 ▲0.2235.23 ▼6.1435.67 ▲0.44
Add New Post /wp-admin/post-new.php1,514 ▼017.72 ▲0.26635.66 ▼37.0568.05 ▲18.47
Media Library /wp-admin/upload.php1,396 ▲144.26 ▲0.01100.14 ▼3.2442.08 ▲0.27

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_envy_popular_post_widget_callback
    • widget_theysaidso_widget
    • widget_envy_recent_post_widget_callback
    • db_upgraded
    • widget_envy_related_post_widget_callback
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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
The following issues need your attention
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/envy-custom-post-widget/includes/widgets/class-envy-popular-post-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/envy-custom-post-widget/public/partials/templates/envy-recent-post-display.php:2
    • > PHP Notice
      Undefined variable: envy_popular_posts_widget_loop in wp-content/plugins/envy-custom-post-widget/public/partials/templates/envy-popular-post-display.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/envy-custom-post-widget/public/partials/templates/envy-popular-post-display.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/envy-custom-post-widget/includes/widgets/class-envy-related-post-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/envy-custom-post-widget/public/partials/templates/envy-related-post-display.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/envy-custom-post-widget/includes/widgets/class-envy-recent-post-widget.php:3
    • > PHP Notice
      Undefined variable: envy_related_posts_widget_loop in wp-content/plugins/envy-custom-post-widget/public/partials/templates/envy-related-post-display.php on line 2
    • > PHP Notice
      Undefined variable: envy_recent_posts_widget_loop in wp-content/plugins/envy-custom-post-widget/public/partials/templates/envy-recent-post-display.php on line 2

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 issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (20 tag instead of maximum 10)
Please take inspiration from this readme.txt

envy-custom-post-widget/envy-custom-post.php 85% from 13 tests

This is the main PHP file of "Envy Custom Post Widget WordPress Plugin" version 1.0.0, 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:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("envy-custom-post-widget.php" instead of "envy-custom-post.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin3,851 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
SVG1002,671
PHP171594601,090
CSS251145
JavaScript410045

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity13.40
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity4.18
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods40
▷ Static methods512.50%
▷ Public methods3587.50%
▷ Protected methods00.00%
▷ Private methods512.50%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There are no PNG files in this plugin