78% tweakr

Code Review | Tweakr - Utility Toolkit

WordPress plugin Tweakr - Utility Toolkit scored78%from 54 tests.

About plugin

  • Plugin page: tweakr
  • Plugin version: 2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.4
  • WordPress version: 6.3.1
  • First release: Feb 23, 2017
  • Latest release: Apr 2, 2020
  • Number of updates: 35
  • Update frequency: every 32.4 days
  • Top authors: Andi Dittrich (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,128 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼9.88ms] Passed 4 tests

Server-side resources used by Tweakr - Utility Toolkit
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.21 ▼9.83
Dashboard /wp-admin3.36 ▲0.0251.38 ▼16.08
Posts /wp-admin/edit.php3.48 ▲0.1253.48 ▲7.73
Add New Post /wp-admin/post-new.php5.94 ▲0.0680.23 ▼14.60
Media Library /wp-admin/upload.php3.29 ▲0.0638.58 ▲0.99
Tweaks /wp-admin/admin.php?page=tweakr-tweaks3.3235.20
Analytics /wp-admin/admin.php?page=tweakr-analytics3.3132.74
About /wp-admin/admin.php?page=tweakr-about3.2932.67
System /wp-admin/admin.php?page=tweakr-system3.3333.51

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Tweakr - Utility Toolkit
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.28 ▼0.461.69 ▼0.0844.32 ▼0.19
Dashboard /wp-admin2,230 ▲505.55 ▼0.1391.47 ▼3.6341.55 ▲1.44
Posts /wp-admin/edit.php2,132 ▲291.98 ▼0.1235.37 ▼0.6834.28 ▼0.31
Add New Post /wp-admin/post-new.php1,554 ▲1922.85 ▲4.82677.20 ▲69.9960.22 ▼4.06
Media Library /wp-admin/upload.php1,435 ▲354.23 ▼0.0699.19 ▼0.0449.05 ▲3.96
Tweaks /wp-admin/admin.php?page=tweakr-tweaks1,6082.1027.0055.06
Analytics /wp-admin/admin.php?page=tweakr-analytics1,3092.2430.5641.83
About /wp-admin/admin.php?page=tweakr-about9732.2024.9454.87
System /wp-admin/admin.php?page=tweakr-system1,5852.1426.2544.58

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • tweakr-version
    • tweakr-cache-hash
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Tweakr\\skltn\\RewriteRuleHelper' not found in wp-content/plugins/tweakr/modules/core/RewriteRules.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/tweakr/Tweakr.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'tweakr\\skltn\\Plugin' not found in wp-content/plugins/tweakr/modules/core/Tweakr.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=tweakr-about
    • > Network (severe)
    wp-content/plugins/tweakr/resources/admin/badge150.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% 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:
  • Tags: Too many tags (20 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

tweakr/Tweakr.php 92% from 13 tests

The entry point to "Tweakr - Utility Toolkit" version 2.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("tweakr.php" instead of "Tweakr.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin3,011 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PHP488869342,468
CSS36356287
JavaScript65391167
LESS15281
HTML1008

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity8.20
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes30
▷ Abstract classes00.00%
▷ Concrete classes30100.00%
▷ Final classes00.00%
Methods146
▷ Static methods4430.14%
▷ Public methods13793.84%
▷ Protected methods32.05%
▷ Private methods64.11%
Functions38
▷ Named functions12.63%
▷ Anonymous functions3797.37%
Constants12
▷ Global constants866.67%
▷ Class constants433.33%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/admin/badge80.png4.88KB2.18KB▼ 55.25%
resources/admin/badge40.png3.71KB1.35KB▼ 63.75%