83% wp-phone-number

Code Review | WP Phone Number

WordPress plugin WP Phone Number scored83%from 54 tests.

About plugin

  • Plugin page: wp-phone-number
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9
  • WordPress version: 6.3.1
  • First release: Oct 5, 2015
  • Latest release: May 9, 2018
  • Number of updates: 9
  • Update frequency: every 105.6 days
  • Top authors: sergey-fritzler (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /4,887 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.60ms] Passed 4 tests

An overview of server-side resources used by WP Phone Number
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.27 ▼1.35
Dashboard /wp-admin3.31 ▲0.0149.27 ▼5.00
Posts /wp-admin/edit.php3.36 ▲0.0048.22 ▼6.02
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.22 ▼14.01
Media Library /wp-admin/upload.php3.23 ▲0.0039.51 ▲1.91

Server storage [IO: ▲0.08MB] [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: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WP Phone Number
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.24 ▼0.001.67 ▼0.4546.01 ▲2.59
Dashboard /wp-admin2,189 ▲95.53 ▼0.1285.10 ▼5.0638.35 ▲1.27
Posts /wp-admin/edit.php2,100 ▲31.98 ▲0.0335.14 ▼2.1434.64 ▼5.10
Add New Post /wp-admin/post-new.php1,526 ▼522.94 ▼0.35686.84 ▲56.0547.17 ▼13.71
Media Library /wp-admin/upload.php1,400 ▲34.20 ▲0.01109.74 ▲13.5550.05 ▲8.22

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 add_shortcode() in wp-content/plugins/wp-phone-number/phone-number.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Please fix this invalid url: ""
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === wp-phone-number === )
You can take inspiration from this readme.txt

wp-phone-number/phone-number.php 92% from 13 tests

"WP Phone Number" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-phone-number.php" instead of "phone-number.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin685 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3164660685

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.98
Average class complexity134.00
▷ Minimum class complexity134.00
▷ Maximum class complexity134.00
Average method complexity4.69
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods36
▷ Static methods925.00%
▷ Public methods3391.67%
▷ Protected methods25.56%
▷ Private methods12.78%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin