83% elegant-category-posts

Code Review | Elegant Category Posts

WordPress plugin Elegant Category Posts scored83%from 54 tests.

About plugin

  • Plugin page: elegant-category-...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.8.3
  • WordPress version: 6.3.1
  • First release: Aug 6, 2016
  • Latest release: Nov 9, 2017
  • Number of updates: 14
  • Update frequency: every 32.9 days
  • Top authors: dwampamba (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /5,360 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

An overview of server-side resources used by Elegant Category Posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.44 ▼0.0324.69 ▼15.27
Dashboard /wp-admin3.36 ▲0.0550.18 ▼2.57
Posts /wp-admin/edit.php3.41 ▲0.0554.43 ▲1.01
Add New Post /wp-admin/post-new.php5.94 ▲0.0597.57 ▲1.15
Media Library /wp-admin/upload.php3.28 ▲0.0536.63 ▲0.03

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
widget_ecats_posts
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Elegant Category Posts: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.34 ▼0.181.84 ▲0.2043.12 ▲2.31
Dashboard /wp-admin2,195 ▲155.55 ▼0.0194.19 ▲2.6937.86 ▼3.41
Posts /wp-admin/edit.php2,100 ▼32.00 ▲0.0342.87 ▼1.0636.04 ▼4.49
Add New Post /wp-admin/post-new.php1,526 ▼023.20 ▲0.01631.77 ▼25.4057.94 ▲0.60
Media Library /wp-admin/upload.php1,400 ▲34.21 ▲0.0698.33 ▼3.0441.65 ▼3.83

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
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_ecats_posts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/elegant-category-posts/ecat-posts.php:13

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

elegant-category-posts/ecat-posts.php 92% from 13 tests

The primary PHP file in "Elegant Category Posts" version 1.0.2 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("elegant-category-posts.php" instead of "ecat-posts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected191 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP12211173
Markdown18018

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity29.00
▷ Minimum class complexity29.00
▷ Maximum class complexity29.00
Average method complexity8.00
▷ Minimum method complexity1.00
▷ Maximum method complexity14.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%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.06MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) assets/screenshot-1.png17.10KB0.00KB▼ 100.00%
(invalid) assets/screenshot-2.png15.79KB0.00KB▼ 100.00%
(invalid) assets/screenshot-3.png32.70KB0.00KB▼ 100.00%