84% posts-and-products-views

Code Review | Posts and Products Views for WooCommerce

WordPress plugin Posts and Products Views for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: posts-and-product...
  • Plugin version: 2.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 12, 2021
  • Latest release: Jul 20, 2023
  • Number of updates: 25
  • Update frequency: every 35.6 days
  • Top authors: smusman98 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

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

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.05ms] Passed 4 tests

Analyzing server-side resources used by Posts and Products Views for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.0749.83 ▲6.93
Dashboard /wp-admin3.68 ▲0.1149.99 ▼5.75
Posts /wp-admin/edit.php3.73 ▲0.0549.67 ▼0.14
Add New Post /wp-admin/post-new.php6.20 ▲0.0592.58 ▼13.76
Media Library /wp-admin/upload.php3.54 ▲0.0541.73 ▲3.44

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Posts and Products Views for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6514.23 ▼0.131.89 ▲0.1548.21 ▲9.44
Dashboard /wp-admin2,193 ▲125.57 ▼0.1891.39 ▼4.3641.60 ▼1.51
Posts /wp-admin/edit.php2,114 ▲142.01 ▼0.0035.36 ▼3.8831.87 ▼4.38
Add New Post /wp-admin/post-new.php6,231 ▲4,70526.26 ▲8.86935.18 ▲225.5262.18 ▲7.56
Media Library /wp-admin/upload.php1,407 ▲74.17 ▼0.07102.59 ▼4.5743.68 ▼2.30

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/posts-and-products-views/includes/metabox.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed: You can take inspiration from this readme.txt

posts-and-products-views/posts-and-products-views-for-woocommerce.php 92% from 13 tests

"Posts and Products Views for WooCommerce" version 2.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("posts-and-products-views.php" instead of "posts-and-products-views-for-woocommerce.php")

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
No dangerous file extensions were detected251 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP544142196
Markdown113038
CSS11017

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity7.00
▷ Minimum class complexity6.00
▷ Maximum class complexity8.00
Average method complexity1.55
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin