83% posttype-widget

Code Review | PostType-Widget

WordPress plugin PostType-Widget scored 83% from 54 tests.

About plugin

  • Plugin page: posttype-widget
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 1.2-5.2
  • WordPress version: 6.3.1
  • First release: Feb 17, 2017
  • Latest release: Oct 23, 2019
  • Number of updates: 6
  • Update frequency: every 163.0 days
  • Top authors: dimonuch (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 695 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.03MB] [CPU: ▼5.78ms] Passed 4 tests

A check of server-side resources used by PostType-Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0446.04 ▼0.86
Dashboard /wp-admin3.33 ▲0.0343.85 ▼5.18
Posts /wp-admin/edit.php3.38 ▲0.0347.45 ▲2.42
Add New Post /wp-admin/post-new.php5.91 ▲0.0387.33 ▼15.07
Media Library /wp-admin/upload.php3.25 ▲0.0234.92 ▼2.00

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
widget_true_top_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for PostType-Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▲0.101.57 ▼0.6243.52 ▼2.45
Dashboard /wp-admin2,203 ▲125.85 ▲0.92101.08 ▼2.9340.10 ▼7.17
Posts /wp-admin/edit.php2,086 ▼02.01 ▼0.0439.60 ▲2.4234.36 ▲1.43
Add New Post /wp-admin/post-new.php1,537 ▲1823.41 ▲0.33670.10 ▲85.5957.92 ▲10.41
Media Library /wp-admin/upload.php1,385 ▼34.23 ▲0.03105.48 ▲10.4246.47 ▲3.78

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_true_top_widget
    • can_compress_scripts
    • db_upgraded

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 no errors were found, this is by no means an exhaustive test

SRP 50% 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 trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/posttype-widget/posttypewidget.php:33

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 on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% 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:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Screenshot #1 (Options widget) image missing
You can take inspiration from this readme.txt

posttype-widget/posttypewidget.php 77% from 13 tests

The principal PHP file in "PostType-Widget" v. 1.2 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("posttype-widget.php" instead of "posttypewidget.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Description: Keep the plugin description shorter than 140 characters (currently 163 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin374 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PO File4111180230
PHP16338144

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity8.75
▷ 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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png36.74KB8.41KB▼ 77.10%