10% wcz-hot-posts

Code Review | WCZ Hot Posts

WordPress plugin WCZ Hot Posts scored10%from 54 tests.

About plugin

  • Plugin page: wcz-hot-posts
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.8.1
  • WordPress version: 6.3.1
  • First release: Jan 28, 2014
  • Latest release: Jul 24, 2014
  • Number of updates: 11
  • Update frequency: every 16.2 days
  • Top authors: fida02 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /1,587 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
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/wcz-hot-posts/wcz-hot-posts.php+69
    Methods with the same name as their class will not be constructors in a future version of PHP; WCZHotPosts has a deprecated constructor

Server metrics [RAM: ▼1.92MB] [CPU: ▼51.39ms] Passed 4 tests

An overview of server-side resources used by WCZ Hot Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.404.21 ▼42.39
Dashboard /wp-admin2.08 ▼1.225.27 ▼48.63
Posts /wp-admin/edit.php2.08 ▼1.276.03 ▼38.41
Add New Post /wp-admin/post-new.php2.08 ▼3.807.42 ▼76.12
Media Library /wp-admin/upload.php2.08 ▼1.155.12 ▼31.33

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WCZ Hot Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲7513.76 ▼0.491.79 ▼0.0043.08 ▼0.90
Dashboard /wp-admin2,226 ▲355.84 ▼0.06100.87 ▼4.0874.83 ▲33.10
Posts /wp-admin/edit.php2,109 ▲172.02 ▼0.0134.92 ▼0.0531.28 ▼2.77
Add New Post /wp-admin/post-new.php1,535 ▲123.10 ▲0.05676.80 ▲39.8653.39 ▼1.72
Media Library /wp-admin/upload.php1,405 ▲174.17 ▼0.0993.97 ▼3.9377.26 ▲34.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/wcz-hot-posts/wcz-hot-posts.php+69
    Methods with the same name as their class will not be constructors in a future version of PHP; WCZHotPosts has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/wcz-hot-posts/admin/usage.php
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_image_size() in wp-content/plugins/wcz-hot-posts/wcz-hot-posts.php:52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wczhp_sidebar() in wp-content/plugins/wcz-hot-posts/admin/usage.php:55
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wcz-hot-posts/wcz-hot-posts.php on line 30
    • > 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/wcz-hot-posts/wcz-hot-posts.php on line 31
    • > 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/wcz-hot-posts/admin/usage.php on line 1
    • > 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/wcz-hot-posts/admin/usage.php on line 47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wcz-hot-posts/wcz_admin.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% 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
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 17 tag instead of maximum 10
You can look at the official readme.txt

wcz-hot-posts/wcz-hot-posts.php Passed 13 tests

The main file in "WCZ Hot Posts" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
122 characters long description:
This plugin shows most commented posts of last month with thumbnail, title, author's avatar of the posts in a dynamic way.

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 plugin177 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP44325169
CSS1008

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 compressed PNG files occupy 0.01MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon2.png0.53KB0.42KB▼ 20.19%
img/icon.png0.85KB0.85KB0.00%
img/wcz.png10.91KB10.81KB▼ 0.92%