84% wp-tinypng

Code Review | WP TinyPNG

WordPress plugin WP TinyPNG scored84%from 54 tests.

About plugin

  • Plugin page: wp-tinypng
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.3
  • WordPress version: 6.3.1
  • First release: Jan 14, 2014
  • Latest release: Jan 15, 2014
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: optimising (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /1,960 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼6.95ms] Passed 4 tests

Server-side resources used by WP TinyPNG
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1342.54 ▲3.92
Dashboard /wp-admin3.42 ▲0.0746.80 ▼17.80
Posts /wp-admin/edit.php3.53 ▲0.1745.20 ▲0.66
Add New Post /wp-admin/post-new.php6.00 ▲0.1179.00 ▼14.56
Media Library /wp-admin/upload.php3.34 ▲0.1136.78 ▲4.98
PNG Compression /wp-admin/upload.php?page=wp-tinypng3.3132.48

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

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

Browser metrics Passed 4 tests

WP TinyPNG: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.26 ▼1.124.41 ▲2.8942.65 ▲1.28
Dashboard /wp-admin2,210 ▲255.88 ▲0.9395.20 ▼53.7339.75 ▼8.53
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0033.01 ▼1.1432.31 ▼5.04
Add New Post /wp-admin/post-new.php1,536 ▲722.80 ▼0.39669.46 ▲52.6351.73 ▼2.23
Media Library /wp-admin/upload.php1,395 ▲74.23 ▲0.0695.23 ▲0.8044.93 ▲1.61
PNG Compression /wp-admin/upload.php?page=wp-tinypng7562.0223.6223.08

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
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 add_filter() in wp-content/plugins/wp-tinypng/wp-tinypng.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === wp-tinypng === )
You can take inspiration from this readme.txt

wp-tinypng/wp-tinypng.php Passed 13 tests

"WP TinyPNG" version 0.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
91 characters long description:
Compresses images on your posts, pages and media library using the TinyPNG compression API.

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
Success! There were no dangerous files found in this plugin909 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3324387909

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity38.80
▷ Minimum class complexity1.00
▷ Maximum class complexity115.00
Average method complexity4.86
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods49
▷ Static methods00.00%
▷ Public methods4795.92%
▷ Protected methods24.08%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants777.78%
▷ Class constants222.22%
▷ Public constants2100.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
PNG images were not found in this plugin