72% yawp-utils

Code Review | YAWP Utils

WordPress plugin YAWP Utils scored72%from 54 tests.

About plugin

  • Plugin page: yawp-utils
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.0
  • WordPress version: 6.3.1
  • First release: Aug 29, 2019
  • Latest release: Aug 10, 2022
  • Number of updates: 8
  • Update frequency: every 134.6 days
  • Top authors: rhashemian (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /536 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
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼1.39ms] Passed 4 tests

A check of server-side resources used by YAWP Utils
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.73 ▲2.77
Dashboard /wp-admin3.36 ▲0.0548.60 ▼2.59
Posts /wp-admin/edit.php3.41 ▲0.0549.28 ▲2.98
Add New Post /wp-admin/post-new.php5.94 ▲0.0584.73 ▼5.34
Media Library /wp-admin/upload.php3.28 ▲0.0535.18 ▼0.39
YAWP Set Email /wp-admin/options-general.php?page=yawp-utils/yawp-utils.php.mail3.2232.91
YAWP Find/Replace /wp-admin/options-general.php?page=yawp-utils/yawp-utils.php.replace3.2232.20

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by YAWP Utils
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6214.60 ▲0.221.78 ▲0.1840.77 ▼2.60
Dashboard /wp-admin2,214 ▲295.79 ▲0.8896.56 ▼21.4636.88 ▼6.98
Posts /wp-admin/edit.php2,097 ▲82.00 ▼0.0138.07 ▲1.3934.15 ▲4.09
Add New Post /wp-admin/post-new.php1,525 ▲623.28 ▲0.15642.68 ▲29.4649.11 ▼13.25
Media Library /wp-admin/upload.php1,399 ▲174.25 ▲0.0598.43 ▼1.8241.39 ▼1.59
YAWP Set Email /wp-admin/options-general.php?page=yawp-utils/yawp-utils.php.mail8272.1825.0927.67
YAWP Find/Replace /wp-admin/options-general.php?page=yawp-utils/yawp-utils.php.replace9532.0324.7455.71

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=yawp-utils/yawp-utils.php.replace
    • > Notice in wp-content/plugins/yawp-utils/yawp.searchreplace.php+102
    Undefined variable: yawp_utils_message
    • > GET request to /wp-admin/options-general.php?page=yawp-utils/yawp-utils.php.mail
    • > Notice in wp-content/plugins/yawp-utils/yawp.mail.php+68
    Undefined index: yawptestemail

SRP 0% 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 fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/yawp-utils/yawp-utils.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/yawp-utils/yawp.mail.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/yawp-utils/yawp.shortcodes.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/yawp-utils/yawp.searchreplace.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were 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 require attention:
  • Screenshots: These screenshots do not have images: #1 (Set Email Address Settings in Admin panel.), #2 (Search/Replace Settings in Admin panel.)
You can take inspiration from this readme.txt

yawp-utils/yawp-utils.php 92% from 13 tests

The principal PHP file in "YAWP Utils" v. 1.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 154 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin290 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP52044215
JavaScript221339
CSS20036

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions321.43%
▷ Anonymous functions1178.57%
Constants2
▷ Global constants2100.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
3 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/yawp-logo.png27.34KB9.50KB▼ 65.27%
assets/yawp-screenshot-1.png11.54KB6.89KB▼ 40.29%
assets/yawp-screenshot-2.png20.66KB11.56KB▼ 44.03%