68% what-i-charge

Code Review | What I Charge

WordPress plugin What I Charge scored68%from 54 tests.

About plugin

  • Plugin page: what-i-charge
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.5.2
  • WordPress version: 6.3.1
  • First release: Jul 20, 2016
  • Latest release: Jul 20, 2016
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: squiggledev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /554 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼14.76ms] Passed 4 tests

Analyzing server-side resources used by What I Charge
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.42 ▼0.0426.52 ▼16.53
Dashboard /wp-admin3.35 ▲0.0042.36 ▼16.40
Posts /wp-admin/edit.php3.40 ▲0.0443.53 ▼3.07
Add New Post /wp-admin/post-new.php5.95 ▲0.0680.89 ▼23.02
Media Library /wp-admin/upload.php3.27 ▲0.0435.16 ▼0.69
Settings /wp-admin/admin.php?page=what_i_charge_settings_menu3.3132.02
What I Charge /wp-admin/admin.php?page=what_i_charge_menu3.0927.03

Server storage [IO: ▲1.11MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 64 new files
Database: no new tables, 38 new options
New WordPress options
wdic_service_heading_color
wdic_negative_btn_background_color
wdic_currency_input
wdic_submit_button_text
db_upgraded
wdic_check_bg_check_color
email_error_text_label
theysaidso_admin_options
wdic_toggle_off_color
success_text_label
...

Browser metrics Passed 4 tests

What I Charge: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲14713.53 ▼0.8211.20 ▲9.5942.17 ▼0.10
Dashboard /wp-admin2,223 ▲435.56 ▼0.0582.05 ▼4.0837.16 ▼2.92
Posts /wp-admin/edit.php2,131 ▲492.00 ▲0.0135.58 ▼0.4333.87 ▼1.06
Add New Post /wp-admin/post-new.php1,553 ▲2722.71 ▼1.02622.10 ▼35.4950.00 ▼2.96
Media Library /wp-admin/upload.php1,431 ▲314.16 ▼0.0696.26 ▼13.4642.33 ▼4.49
Settings /wp-admin/admin.php?page=what_i_charge_settings_menu1,0161.7227.3335.42
What I Charge /wp-admin/admin.php?page=what_i_charge_menu8121.8332.7927.40

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'SquiggleDevWDIC\WhatICharge' does not have a method 'degregisterPlugin'
  • This plugin did not uninstall successfully, leaving 38 options in the database
    • wdic_drop_select_option_color
    • can_compress_scripts
    • wdic_service_heading_color
    • wdic_affirmative_btn_background_color
    • wdic_service_description_color
    • wdic_drop_bg_color
    • wdic_cancel_button_text
    • wdic_toggle_on_color
    • wdic_submit_button_text
    • wdic_check_bg_check_color
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=what_i_charge_menu
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

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
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/what-i-charge/views/admin_dropdown_view.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function SquiggleDevWDIC\\add_action() in wp-content/plugins/what-i-charge/plugin.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/what-i-charge/views/frontend/frontend_dropdown_view.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/what-i-charge/views/admin_edit_view.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/what-i-charge/views/admin_toggle_view.php:15
    • > PHP Notice
      Undefined property: stdClass::$textColor in wp-content/plugins/what-i-charge/views/admin_checkbox_view.php on line 24
    • > PHP Notice
      Undefined variable: checkCardColor in wp-content/plugins/what-i-charge/views/frontend/frontend_checkbox_view.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/what-i-charge/what_i_charge_frontend.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/what-i-charge/views/frontend/frontend_checkbox_view.php:6
    • > PHP Notice
      Undefined variable: dropCardColor in wp-content/plugins/what-i-charge/views/frontend/frontend_dropdown_view.php on line 1

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: price generator, freelance, price, rate, charge...

what-i-charge/plugin.php 92% from 13 tests

"What I Charge" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("what-i-charge.php" instead of "plugin.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
There were no executable files found in this plugin6,531 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
Sass16600752,693
CSS101051122,233
PHP14323251,000
JavaScript412227558
SVG10141
Ruby16136

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity58.00
▷ Minimum class complexity58.00
▷ Maximum class complexity58.00
Average method complexity4.80
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods16.67%
▷ Public methods15100.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 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 PNG files occupy 0.85MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
views/images/buttonOptions.png57.02KB18.54KB▼ 67.49%
views/images/wdic-dropdown-arrow-black.png1.52KB1.66KB0.00%
views/images/wdicDownArrow.png0.92KB1.13KB0.00%
views/images/toggleOptions.png32.57KB11.54KB▼ 64.57%
assets/screenshot-2.png332.27KB169.43KB▼ 49.01%