77% google-shortlink

Code Review | Shortlink by BestWebSoft

WordPress plugin Shortlink by BestWebSoft scored77%from 54 tests.

About plugin

  • Plugin page: google-shortlink
  • Plugin version: 1.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Feb 21, 2014
  • Latest release: Aug 11, 2023
  • Number of updates: 42
  • Update frequency: every 82.4 days
  • Top authors: bestwebsoft (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /19,353 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 gracefully, with no errors

Server metrics [RAM: ▲0.97MB] [CPU: ▼1.96ms] Passed 4 tests

Analyzing server-side resources used by Shortlink by BestWebSoft
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.49 ▲1.0242.41 ▼0.39
Dashboard /wp-admin4.31 ▲0.9752.05 ▼8.71
Posts /wp-admin/edit.php4.36 ▲1.0158.22 ▲14.86
Add New Post /wp-admin/post-new.php6.85 ▲0.9791.24 ▼9.52
Media Library /wp-admin/upload.php4.17 ▲0.9543.82 ▲10.77
Add New /wp-admin/admin.php?page=gglshrtlnk_create_link4.1537.27
Settings /wp-admin/admin.php?page=gglshrtlnk_options4.5252.84
Links /wp-admin/admin.php?page=google-shortlink4.1644.61
BWS Panel /wp-admin/admin.php?page=gglshrtlnk-bws-panel4.4744.65

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 808 new files
Database: 2 new tables, 8 new options
New tables
wp_google_shortlink_for_firebase
wp_google_shortlink
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
bstwbsftwppdtplgns_options
widget_recent-comments
gglshrtlnk_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Shortlink by BestWebSoft
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲6613.21 ▼1.161.59 ▼0.2637.36 ▼4.35
Dashboard /wp-admin2,240 ▲585.84 ▼0.0298.29 ▼6.0138.99 ▲2.08
Posts /wp-admin/edit.php2,126 ▲342.05 ▼0.0143.18 ▲3.4534.15 ▼0.27
Add New Post /wp-admin/post-new.php1,562 ▲3423.31 ▲5.06586.57 ▼41.5047.66 ▼0.51
Media Library /wp-admin/upload.php1,422 ▲374.26 ▲0.0295.48 ▼9.6844.55 ▼2.15
Add New /wp-admin/admin.php?page=gglshrtlnk_create_link9193.2666.6425.67
Settings /wp-admin/admin.php?page=gglshrtlnk_options2,0664.04105.4376.86
Links /wp-admin/admin.php?page=google-shortlink1,0223.1838.5528.76
BWS Panel /wp-admin/admin.php?page=gglshrtlnk-bws-panel3,0251.9832.8975.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

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
  • 537× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_Resource' not found in wp-content/plugins/google-shortlink/vendor/google/apiclient-services/src/Google/Service/Analytics/Resource/ManagementWebproperties.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Cache\\CacheItemInterface' not found in wp-content/plugins/google-shortlink/vendor/google/auth/src/Cache/Item.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/google-shortlink/vendor/google/apiclient-services/src/Google/Service/FirebaseRules/GetReleaseExecutableResponse.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/google-shortlink/vendor/google/apiclient-services/src/Google/Service/Firestore/FieldTransform.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/google-shortlink/vendor/google/apiclient-services/src/Google/Service/Analytics/WebPropertySummary.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/google-shortlink/vendor/google/apiclient-services/src/Google/Service/Devprojects/ActivationLink.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/google-shortlink/vendor/google/apiclient-services/src/Google/Service/IdentityToolkit/DownloadAccountResponse.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_Resource' not found in wp-content/plugins/google-shortlink/vendor/google/apiclient-services/src/Google/Service/Analytics/Resource/Management.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/google-shortlink/vendor/google/apiclient-services/src/Google/Service/Analytics/WebPropertyRef.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service_Resource' not found in wp-content/plugins/google-shortlink/vendor/google/apiclient-services/src/Google/Service/Analytics/Resource/DataRealtime.php:26

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/custom-admin-page/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/custom-search-plugin/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/captcha-bws/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/contact-form-plugin/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/columns-bws/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/contact-form-to-db/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/donate-button/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/facebook-button-plugin/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/gallery-plugin/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-google-2-step-verification/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/error-log-viewer/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-google-analytics/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/google-captcha/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-google-maps/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/google-sitemap-plugin/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/google-shortlink/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/htaccess/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/job-board/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-linkedin/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/multilanguage/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/limit-attempts/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/pagination/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/pdf-print/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-pinterest/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/portfolio/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/post-to-csv/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/promobar/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/profile-extra-fields/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/quotes-and-tips/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/rating-bws/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/realty/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/slider-bws/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/relevant/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-smtp/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/sender/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/social-buttons-pack/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/social-login-bws/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/bws-testimonials/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/timesheet/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/subscriber/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/updater/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/user-role/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/twitter-plugin/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=gglshrtlnk-bws-panel
    • > Network (severe)
    http://ps.w.org/visitors-online/assets/icon-256x256.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 ('Table of links' page.), #2 ('Add links' page.), #3 (Plugin settings page in WordPress admin panel.), #4 (Plugin settings page in WordPress admin panel.)
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

google-shortlink/google-shortlink.php Passed 13 tests

The principal PHP file in "Shortlink by BestWebSoft" v. 1.6.2 is loaded by WordPress automatically on each request
86 characters long description:
Replace external WordPress website links with Google shortlinks and track click stats.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin81,477 lines of code in 709 files:
LanguageFilesBlank linesComment linesLines of code
PHP6407,28732,09562,016
PO File103,7525,8138,057
CSS101902805,571
Markdown211,21103,891
JSON12001,095
JavaScript738115623
SVG400150
YAML29038
XML20027
make1409

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 103)
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity9.25
▷ Minimum class complexity1.00
▷ Maximum class complexity626.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity103.00
Code structure
Namespaces26
Interfaces22
Traits5
Classes593
▷ Abstract classes40.67%
▷ Concrete classes58999.33%
▷ Final classes91.53%
Methods5,614
▷ Static methods1001.78%
▷ Public methods5,42596.63%
▷ Protected methods150.27%
▷ Private methods1743.10%
Functions232
▷ Named functions13759.05%
▷ Anonymous functions9540.95%
Constants302
▷ Global constants237.62%
▷ Class constants27992.38%
▷ Public constants279100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
63 PNG files occupy 3.26MB with 1.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
bws_menu/css/jquery-ui-styles/1.12.1/images/ui-icons_2e83ff_256x240.png4.57KB4.18KB▼ 8.43%
screenshot-4.png161.48KB52.08KB▼ 67.75%
screenshot-1.png173.59KB60.10KB▼ 65.38%
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%