84% google-knowledge-phone-number

Code Review | Google Knowledge Phone Number

WordPress plugin Google Knowledge Phone Number scored84%from 54 tests.

About plugin

  • Plugin page: google-knowledge-...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.8
  • WordPress version: 6.3.1
  • First release: Aug 22, 2014
  • Latest release: Dec 19, 2016
  • Number of updates: 20
  • Update frequency: every 51.2 days
  • Top authors: tabrisrp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,080 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.16MB] [CPU: ▼4.19ms] Passed 4 tests

A check of server-side resources used by Google Knowledge Phone Number
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0738.47 ▲0.44
Dashboard /wp-admin3.49 ▲0.1947.65 ▲3.39
Posts /wp-admin/edit.php3.61 ▲0.2548.14 ▼0.57
Add New Post /wp-admin/post-new.php6.07 ▲0.1984.13 ▼15.95
Media Library /wp-admin/upload.php3.42 ▲0.1937.08 ▼0.69
Google Knowledge Phone Number /wp-admin/options-general.php?page=google-knowledge-phone-number3.3832.26

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 17 new options
New WordPress options
gkpn_customer_support
gkpn_reservations
theysaidso_admin_options
gkpn_emergency
gkpn_baggage_tracking
gkpn_bill_payment
widget_recent-comments
widget_recent-posts
gkpn_package_tracking
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Google Knowledge Phone Number: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6014.27 ▼0.011.99 ▲0.3240.17 ▼2.85
Dashboard /wp-admin2,196 ▲165.64 ▼0.0182.57 ▼3.8539.80 ▼0.93
Posts /wp-admin/edit.php2,101 ▲12.03 ▲0.0734.89 ▼1.5832.98 ▲0.44
Add New Post /wp-admin/post-new.php1,531 ▲323.27 ▲0.24627.03 ▼0.2654.90 ▼7.34
Media Library /wp-admin/upload.php1,398 ▼54.21 ▼0.0098.94 ▼2.0741.35 ▼4.39
Google Knowledge Phone Number /wp-admin/options-general.php?page=google-knowledge-phone-number1,5991.8534.8740.18

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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 following issues need your attention
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_front_page() in wp-content/plugins/google-knowledge-phone-number/public/views/public.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/google-knowledge-phone-number/admin/views/admin.php:17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: phone number, seo, knowledge graph, rich-snippets, google

google-knowledge-phone-number/google-knowledge-phone-number.php Passed 13 tests

The principal PHP file in "Google Knowledge Phone Number" v. 1.0.2 is loaded by WordPress automatically on each request
114 characters long description:
Add JSON-LD markup in your WordPress website, to display your company's phone number(s) on Google Knowledge Panels

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin674 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP8131359489
PO File24852185

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity14.33
▷ Minimum class complexity3.00
▷ Maximum class complexity30.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods26
▷ Static methods311.54%
▷ Public methods2492.31%
▷ Protected methods00.00%
▷ Private methods27.69%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin