83% post-types-image-sizes

Code Review | Post Types Image Sizes

WordPress plugin Post Types Image Sizes scored 83% from 54 tests.

About plugin

  • Plugin page: post-types-image-...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Nov 1, 2016
  • Latest release: Jan 22, 2017
  • Number of updates: 36
  • Update frequency: every 2.3 days
  • Top authors: parselearn (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,146 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 gracefully, with no errors

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

Analyzing server-side resources used by Post Types Image Sizes
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.64 ▼3.98
Dashboard /wp-admin3.33 ▲0.0246.13 ▼3.34
Posts /wp-admin/edit.php3.38 ▲0.0249.74 ▼0.41
Add New Post /wp-admin/post-new.php5.91 ▲0.0287.80 ▼8.45
Media Library /wp-admin/upload.php3.25 ▲0.0236.42 ▲0.33
Post Types Image Sizes /wp-admin/options-general.php?page=post-types-image-sizes3.2232.42

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Post Types Image Sizes
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.59 ▼0.571.72 ▼0.3943.66 ▼6.89
Dashboard /wp-admin2,210 ▲225.86 ▼0.04111.67 ▼2.0537.55 ▼7.08
Posts /wp-admin/edit.php2,093 ▲41.98 ▼0.0639.88 ▲1.0534.98 ▼1.08
Add New Post /wp-admin/post-new.php1,536 ▲223.17 ▼0.08635.85 ▼22.5052.74 ▼8.51
Media Library /wp-admin/upload.php1,389 ▼24.22 ▼0.0493.03 ▼8.7339.92 ▼4.29
Post Types Image Sizes /wp-admin/options-general.php?page=post-types-image-sizes9471.7124.4427.05

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

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)
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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/post-types-image-sizes/ptis.php:24

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)
There were no browser issues found

Optimizations

Plugin configuration 86% 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
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Settings Page) image missing
The official readme.txt might help

post-types-image-sizes/ptis.php 77% from 13 tests

The main PHP script in "Post Types Image Sizes" version 1.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Domain Path: The domain path should use only dashes and lowercase characters ("languages")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")
  • Main file name: The principal plugin file should be the same as the plugin slug ("post-types-image-sizes.php" instead of "ptis.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
Success! There were no dangerous files found in this plugin242 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP22319172
PO File222242670

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity26.00
▷ Minimum class complexity26.00
▷ Maximum class complexity26.00
Average method complexity4.12
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png27.03KB14.91KB▼ 44.86%