83% pz-linkcard

Code Review | Pz-LinkCard

WordPress plugin Pz-LinkCard scored83%from 54 tests.

About plugin

  • Plugin page: pz-linkcard
  • Plugin version: 2.4.8.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 4, 2015
  • Latest release: Nov 23, 2023
  • Number of updates: 258
  • Update frequency: every 11.5 days
  • Top authors: poporon (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

30,000+ active /537,029 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▼1.54ms] Passed 4 tests

Server-side resources used by Pz-LinkCard
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3842.52 ▼2.39
Dashboard /wp-admin3.69 ▲0.3450.18 ▼13.34
Posts /wp-admin/edit.php3.80 ▲0.4452.45 ▲5.85
Add New Post /wp-admin/post-new.php6.29 ▲0.4094.87 ▲6.85
Media Library /wp-admin/upload.php3.61 ▲0.3837.83 ▲3.74
Pz LkC Cache /wp-admin/tools.php?page=pz-linkcard-cacheman3.9537.75
Pz LinkCard /wp-admin/options-general.php?page=pz-linkcard-settings4.6941.24

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 39 new files
Database: 1 new table, 7 new options
New tables
wp_pz_linkcard
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
Pz_LinkCard_options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Pz-LinkCard
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲6514.68 ▲0.281.51 ▼0.3736.19 ▼8.44
Dashboard /wp-admin2,243 ▲625.65 ▼0.0789.83 ▼14.8636.71 ▼9.36
Posts /wp-admin/edit.php2,143 ▲432.04 ▲0.1039.56 ▼0.8735.96 ▼0.69
Add New Post /wp-admin/post-new.php1,569 ▲4323.23 ▲0.08630.32 ▲42.1347.78 ▲0.36
Media Library /wp-admin/upload.php1,446 ▲434.23 ▲0.0097.74 ▲0.3541.68 ▲1.97
Pz LkC Cache /wp-admin/tools.php?page=pz-linkcard-cacheman1,1911.8329.9049.14
Pz LinkCard /wp-admin/options-general.php?page=pz-linkcard-settings7,1181.9143.63220.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 38× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_col() on null in wp-content/plugins/pz-linkcard/lib/pz-linkcard-file-import.php:9
    • > PHP Warning
      Use of undefined constant wp_die - assumed 'wp_die' (this will throw an Error in a future version of PHP) in wp-content/plugins/pz-linkcard/lib/pz-linkcard-cron-alive.php on line 1
    • > PHP Warning
      Use of undefined constant wp_die - assumed 'wp_die' (this will throw an Error in a future version of PHP) in wp-content/plugins/pz-linkcard/lib/pz-linkcard-modal.php on line 1
    • > PHP Warning
      Use of undefined constant wp_die - assumed 'wp_die' (this will throw an Error in a future version of PHP) in wp-content/plugins/pz-linkcard/lib/pz-linkcard-init.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/pz-linkcard/lib/pz-linkcard-cacheman-list.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pz-linkcard/lib/pz-linkcard-style.php:3
    • > PHP Warning
      Use of undefined constant wp_die - assumed 'wp_die' (this will throw an Error in a future version of PHP) in wp-content/plugins/pz-linkcard/lib/pz-linkcard-file-import.php on line 1
    • > PHP Warning
      Use of undefined constant wp_die - assumed 'wp_die' (this will throw an Error in a future version of PHP) in wp-content/plugins/pz-linkcard/lib/pz-linkcard-settings.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/pz-linkcard/lib/pz-linkcard-modal.php:4
    • > PHP Warning
      Use of undefined constant wp_die - assumed 'wp_die' (this will throw an Error in a future version of PHP) in wp-content/plugins/pz-linkcard/lib/pz-linkcard-settings-validate.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 ("Options screen"), #2 ("Cache manager screen"), #3 ("Edit cache data"), #4 ("The appearance of the 'LinkCard'"), #5 ("Write shortcode and url")
Please take inspiration from this readme.txt

pz-linkcard/pz-linkcard.php 92% from 13 tests

This is the main PHP file of "Pz-LinkCard" version 2.4.8.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Domain Path: The domain path folder was not found ("/language")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin7,485 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP184704715,420
PO File1622920996
CSS222121828
JavaScript44038241

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 185)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity566.00
▷ Minimum class complexity566.00
▷ Maximum class complexity566.00
Average method complexity14.78
▷ Minimum method complexity1.00
▷ Maximum method complexity185.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods41
▷ Static methods00.00%
▷ Public methods1843.90%
▷ Protected methods00.00%
▷ Private methods2356.10%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.22MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png5.94KB3.12KB▼ 47.48%
screenshot-3.png43.00KB19.13KB▼ 55.51%
screenshot-1.png67.59KB23.30KB▼ 65.53%
img/link.png0.25KB0.15KB▼ 40.32%
screenshot-2.png80.72KB30.88KB▼ 61.75%