89% phone-button

Code Review | Phone Button

WordPress plugin Phone Button scored89%from 54 tests.

About plugin

  • Plugin page: phone-button
  • Plugin version: 2.1.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 4, 2020
  • Latest release: Aug 21, 2023
  • Number of updates: 21
  • Update frequency: every 57.3 days
  • Top authors: yydevelopment (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /2,826 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.01MB] [CPU: ▼3.94ms] Passed 4 tests

Server-side resources used by Phone Button
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0333.57 ▼7.98
Dashboard /wp-admin3.32 ▲0.0145.51 ▲0.34
Posts /wp-admin/edit.php3.37 ▲0.0149.56 ▲3.26
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.63 ▼11.37
Media Library /wp-admin/upload.php3.24 ▲0.0136.00 ▲3.98
Phone Button /wp-admin/options-general.php?page=yydev-phone-btn3.3136.70

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
yydev_phone_btn
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
yydev_phone_btn_timestamp

Browser metrics Passed 4 tests

Checking browser requirements for Phone Button
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7313.19 ▼1.184.18 ▲2.2439.42 ▼11.28
Dashboard /wp-admin2,210 ▲224.87 ▼1.03110.49 ▲5.9041.53 ▼3.87
Posts /wp-admin/edit.php2,093 ▲71.99 ▼0.0235.00 ▼0.7433.55 ▲0.38
Add New Post /wp-admin/post-new.php1,523 ▼023.04 ▼0.22664.16 ▲0.3448.59 ▼5.27
Media Library /wp-admin/upload.php1,395 ▲104.24 ▲0.0198.29 ▼5.8842.75 ▲0.12
Phone Button /wp-admin/options-general.php?page=yydev-phone-btn1,3963.0245.4780.30

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • yydev_phone_btn_timestamp
    • widget_recent-comments
    • yydev_phone_btn
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 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)
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The SRP test was a success

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Requires at least: Invalid version format
Please take inspiration from this readme.txt

phone-button/index.php 92% from 13 tests

Analyzing the main PHP file in "Phone Button" version 2.1.1
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("phone-button.php" instead of "index.php")

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 plugin795 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP9339193795

PHP code Passed 2 tests

A short review of 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.25
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%
Functions17
▷ Named functions1482.35%
▷ Anonymous functions317.65%
Constants0
▷ Global constants00.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon.png1.87KB1.99KB0.00%
images/phone.png0.46KB0.47KB0.00%