72% cp-phone-link

Code Review | CP Phone Link

WordPress plugin CP Phone Link scored 72% from 54 tests.

About plugin

  • Plugin page: cp-phone-link
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.3.2
  • WordPress version: 5.8.1
  • First release: Oct 20, 2016
  • Latest release: Jan 13, 2020
  • Number of updates: 47
  • Update frequency: every 25.1 days
  • Top authors: easycpmods (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,976 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.75MB] [CPU: ▼169.70ms] Passed 4 tests

An overview of server-side resources used by CP Phone Link
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.2139.75 ▲14.40
Dashboard /wp-admin2.90 ▼0.1622.59 ▼22.91
Posts /wp-admin/edit.php2.90 ▼0.2126.88 ▼16.81
Add New Post /wp-admin/post-new.php2.90 ▼2.5426.48 ▼629.36
Media Library /wp-admin/upload.php2.90 ▼0.1026.06 ▼9.72
CP Phone Link /wp-admin/options-general.php?page=ecpm_cpl_settings_page2.9026.51

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 46 new files
Database: no new tables, 1 new option
New WordPress options
ecpm_cpl_settings

Browser metrics Passed 4 tests

CP Phone Link: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,792 ▲19616.71 ▲1.3812.33 ▲3.5748.16 ▼3.46
Dashboard /wp-admin2,978 ▲416.09 ▲0.16142.49 ▼13.29125.40 ▼1.48
Posts /wp-admin/edit.php2,744 ▲52.69 ▼0.0169.59 ▲0.3490.05 ▲0.02
Add New Post /wp-admin/post-new.php1,686 ▲318.77 ▲0.01391.46 ▲4.45116.67 ▲3.86
Media Library /wp-admin/upload.php1,812 ▲25.00 ▼0.02151.07 ▼13.41126.73 ▼1.23
CP Phone Link /wp-admin/options-general.php?page=ecpm_cpl_settings_page2,0352.0655.60110.09

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
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/cp-phone-link/ecpm-cpl.php+32
    Use of undefined constant APP_TD - assumed 'APP_TD' (this will throw an Error in a future version of PHP)

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=ecpm_cpl_settings_page
    • > Warning in wp-content/plugins/cp-phone-link/ecpm-cpl.php+32
    Use of undefined constant APP_TD - assumed 'APP_TD' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=ecpm_cpl_settings_page
    • > Notice in wp-includes/wp-db.php+648
    Undefined property: wpdb::$cp_ad_fields

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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/cp-phone-link/ecpm-cpl.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/cp-phone-link/image_sidebar.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=ecpm_cpl_settings_page
    • > Network (severe)
    wp-content/plugins/cp-phone-link/images/easy-qr-codes.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=ecpm_cpl_settings_page
    • > Network (severe)
    wp-content/plugins/cp-phone-link/images/post-private-messages.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 86% 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 your attention:
  • Screenshots: These screenshots do not have images: #1 (Plugin's settings), #2 (Ad details view - Icon on the left), #3 (Ad details view - Icon on the right)
Please take inspiration from this readme.txt

cp-phone-link/ecpm-cpl.php 77% from 13 tests

The entry point to "CP Phone Link" version 1.3.2 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("cp-phone-link.php" instead of "ecpm-cpl.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Please don't use more than 140 characters for the plugin description (currently 152 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected585 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP29114484
PO File1363895
JavaScript1006

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
40 compressed PNG files occupy 0.43MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/phone-icon-2.png0.56KB0.75KB0.00%
images/phone-icon-1.png0.52KB0.71KB0.00%
images/phone-icon-11.png0.57KB0.96KB0.00%
screenshot-2.png16.97KB10.04KB▼ 40.87%
images/phone-icon-8.png0.58KB0.70KB0.00%