90% cat-generator-avatars

Code Review | Cat Generator Avatars

WordPress plugin Cat Generator Avatars scored90%from 54 tests.

About plugin

  • Plugin page: cat-generator-ava...
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Jan 17, 2017
  • Latest release: Dec 25, 2019
  • Number of updates: 7
  • Update frequency: every 152.7 days
  • Top authors: abnerchou (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active /2,472 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼12.99ms] Passed 4 tests

This is a short check of server-side resources used by Cat Generator Avatars
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.15 ▲2.49
Dashboard /wp-admin3.32 ▼0.0351.36 ▼18.57
Posts /wp-admin/edit.php3.37 ▲0.0146.45 ▼8.80
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.54 ▼23.98
Media Library /wp-admin/upload.php3.24 ▲0.0135.11 ▼0.60

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

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

Browser metrics Passed 4 tests

Cat Generator Avatars: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▲0.081.93 ▲0.2643.74 ▲2.85
Dashboard /wp-admin2,198 ▲245.56 ▼0.1290.41 ▲0.5141.58 ▼1.16
Posts /wp-admin/edit.php2,097 ▼32.02 ▲0.0334.98 ▼5.6838.18 ▲3.09
Add New Post /wp-admin/post-new.php1,554 ▲2818.37 ▼5.33591.86 ▼39.6958.74 ▲12.06
Media Library /wp-admin/upload.php1,403 ▲34.25 ▼0.03102.27 ▼11.6242.77 ▼1.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: member, image, bbpress, cat, user...

cat-generator-avatars/cat-generator-avatars.php Passed 13 tests

The main PHP file in "Cat Generator Avatars" ver. 2.1.1 adds more information about the plugin and also serves as the entry point for this plugin
112 characters long description:
This plugin integrates the Cat Generator Avatars avatar placeholder service into WordPress (and now BuddyPress).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected236 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP360162236

PHP code Passed 2 tests

A brief analysis 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.47
Average class complexity49.00
▷ Minimum class complexity49.00
▷ Maximum class complexity49.00
Average method complexity5.36
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods763.64%
▷ Protected methods00.00%
▷ Private methods436.36%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
145 PNG files occupy 1.41MB with 0.66MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/bird/tail_6.png12.88KB6.17KB▼ 52.14%
img/cat/body_11.png28.75KB12.22KB▼ 57.51%
img/cat/mouth_9.png3.29KB2.10KB▼ 36.28%
img/cat/mouth_10.png2.65KB1.59KB▼ 40.11%
img/cat/accessorie_7.png7.95KB4.09KB▼ 48.61%