72% call-center-online

Code Review | Call Me Button for Call Center Online

WordPress plugin Call Me Button for Call Center Online scored72%from 54 tests.

About plugin

  • Plugin page: call-center-online
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.7.1
  • WordPress version: 6.3.1
  • First release: May 6, 2021
  • Latest release: May 10, 2021
  • Number of updates: 30
  • Update frequency: every 0.2 days
  • Top authors: callcenteronline (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /447 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.22MB] [CPU: ▼18.20ms] Passed 4 tests

An overview of server-side resources used by Call Me Button for Call Center Online
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0837.99 ▲0.91
Dashboard /wp-admin3.43 ▲0.0950.15 ▼16.15
Posts /wp-admin/edit.php3.54 ▲0.1952.35 ▲2.33
Add New Post /wp-admin/post-new.php4.72 ▼1.1644.26 ▼59.87
Media Library /wp-admin/upload.php3.35 ▲0.1342.63 ▲5.27
Call Center Online /wp-admin/options-general.php?page=cco_settings_page23.3032.09

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Call Me Button for Call Center Online
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲8213.62 ▼0.691.16 ▼0.5554.08 ▲15.48
Dashboard /wp-admin2,223 ▲205.86 ▼0.04134.46 ▲35.2543.25 ▼1.90
Posts /wp-admin/edit.php2,108 ▲81.98 ▼0.0137.74 ▼1.2833.14 ▼4.57
Add New Post /wp-admin/post-new.php1,399 ▼14616.76 ▼6.31560.41 ▼99.4034.41 ▼26.60
Media Library /wp-admin/upload.php1,402 ▲24.19 ▼0.0498.20 ▼16.0042.82 ▼6.05
Call Center Online /wp-admin/options-general.php?page=cco_settings_page28941.536.8920.44

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • recovery_mode_email_last_sent

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
    • > GET request to /wp-admin/options-general.php?page=cco_settings_page2
    • > Notice in wp-content/plugins/call-center-online/admin/cco-call-me-admin.php+282
    Undefined variable: endpoint
    • > GET request to /wp-admin/options-general.php?page=cco_settings_page2
    • > Notice in wp-content/plugins/call-center-online/admin/cco-call-me-admin.php+292
    Undefined variable: login
    • > GET request to /wp-admin/options-general.php?page=cco_settings_page2
    • > Notice in wp-content/plugins/call-center-online/admin/cco-call-me-admin.php+301
    Undefined variable: password
    • > GET request to /wp-admin/options-general.php?page=cco_settings_page2
    • > Notice in wp-content/plugins/call-center-online/admin/cco-call-me-admin.php+309
    Undefined variable: client_id
    • > GET request to /wp-admin/options-general.php?page=cco_settings_page2
    • > Notice in wp-content/plugins/call-center-online/admin/cco-call-me-admin.php+317
    Undefined variable: client_secret
    • > GET request to /wp-admin/options-general.php?page=cco_settings_page2
    • > Notice in wp-content/plugins/call-center-online/admin/cco-call-me-admin.php+359
    Undefined variable: text_success
    • > GET request to /wp-admin/options-general.php?page=cco_settings_page2
    • > Notice in wp-content/plugins/call-center-online/admin/cco-call-me-admin.php+368
    Undefined variable: text_failed
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cco_settings_page2
    • > Notice in wp-content/plugins/call-center-online/admin/cco-call-me-admin.php+447
    Undefined variable: button_position_x
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cco_settings_page2
    • > Notice in wp-content/plugins/call-center-online/admin/cco-call-me-admin.php+461
    Undefined variable: button_position_y
    • > GET request to /wp-admin/options-general.php?page=cco_settings_page2
    • > Notice in wp-content/plugins/call-center-online/admin/cco-call-me-admin.php+410
    Undefined variable: color
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cco_settings_page2
    • > Notice in wp-content/plugins/call-center-online/includes/api.php+23
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=cco_settings_page2
    • > Error in wp-content/plugins/call-center-online/includes/api.php+37
    Uncaught Error: Cannot use object of type WP_Error as array in wp-content/plugins/call-center-online/includes/api.php:37
    Stack trace:
    #0 wp-content/plugins/call-center-online/includes/api.php(45): cco_api->getToken()
    #1 wp-content/plugins/call-center-online/admin/cco-call-me-admin.php(487): cco_api->getCampaigns()
    #2 wp-admin/includes/template.php(1824): cco_call_me_admin->campaign_callback()
    #3 wp-admin/includes/template.php(1778): do_settings_fields()
    #4 wp-content/plugins/call-center-online/admin/cco-call-me-admin.php(51): do_settings_sections()
    #5 wp-includes/class-wp-hook.php(310): cco_call_me_admin->create_page()
    #6 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #7 wp-includes/plugin.php(517): WP_Hook->do_action()
    #8 wp-admin/admin.php(259): do_action()
    #9 wp-admin/options-general.php

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/call-center-online/admin/cco-call-me-admin.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=cco_settings_page2
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=cco_settings_page2 154 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

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
These attributes need to be fixed:
  • Contributors: The plugin contributors field is missing
You can take inspiration from this readme.txt

call-center-online/cco-call-me.php 92% from 13 tests

The primary PHP file in "Call Me Button for Call Center Online" version 1.0.3 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("call-center-online.php" instead of "cco-call-me.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin998 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP516212667
CSS1223197
JavaScript1260101
Markdown111031
PO File1002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity16.50
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.51
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods41
▷ Static methods00.00%
▷ Public methods4097.56%
▷ Protected methods12.44%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants36
▷ Global constants00.00%
▷ Class constants36100.00%
▷ Public constants36100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.11MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
image/logo-mini.png10.31KB1.70KB▼ 83.50%
image/blue-button.png2.94KB1.49KB▼ 49.17%
image/logo.png25.87KB7.08KB▼ 72.65%
image/banner.png52.93KB15.81KB▼ 70.12%
image/logo-button.png24.75KB1.68KB▼ 93.20%