73% better-click-to-tweet

Code Review | Better Click To Tweet

WordPress plugin Better Click To Tweet scored73%from 54 tests.

About plugin

  • Plugin page: better-click-to-t...
  • Plugin version: 5.12.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.2
  • WordPress version: 6.3.1
  • First release: Nov 20, 2014
  • Latest release: Mar 27, 2023
  • Number of updates: 172
  • Update frequency: every 17.7 days
  • Top authors: ben.meredith@gmail.com (100%)

Code review

54 tests

User reviews

46 reviews

Install metrics

10,000+ active /600,709 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.24MB] [CPU: ▼1.99ms] Passed 4 tests

A check of server-side resources used by Better Click To Tweet
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2344.43 ▼4.20
Dashboard /wp-admin42.15 ▲38.757,981,578.91 ▲7,981,514.60
Posts /wp-admin/edit.php3.68 ▲0.2855.92 ▲2.53
Add New Post /wp-admin/post-new.php6.15 ▲0.2296.80 ▼12.51
Media Library /wp-admin/upload.php3.49 ▲0.2146.55 ▲6.22
Better Click To Tweet /wp-admin/options-general.php?page=better-click-to-tweet3.4643.64

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 60 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Better Click To Tweet
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.58 ▲0.212.37 ▲0.7245.05 ▲1.45
Dashboard /wp-admin2,201 ▲215.59 ▼0.1291.33 ▲1.6943.14 ▲1.28
Posts /wp-admin/edit.php2,106 ▲62.03 ▲0.0335.48 ▲0.3435.02 ▼5.24
Add New Post /wp-admin/post-new.php6,204 ▲4,67618.96 ▼4.07930.02 ▲266.9255.64 ▲3.35
Media Library /wp-admin/upload.php1,406 ▲94.14 ▼0.18102.14 ▼13.5242.13 ▼7.00
Better Click To Tweet /wp-admin/options-general.php?page=better-click-to-tweet1,0552.0228.5944.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=better-click-to-tweet
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=better-click-to-tweet
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

SRP 0% 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
Almost there! Just fix the following items
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/better-click-to-tweet/assets/tinymce/bctt-tinymce.php
    • > /wp-content/plugins/better-click-to-tweet/better-click-to-tweet.php
    • > /wp-content/plugins/better-click-to-tweet/bctt-admin.php
    • > /wp-content/plugins/better-click-to-tweet/bctt_options.php
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-click-to-tweet/bctt-welcome-functions.php:104
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/better-click-to-tweet/includes/views/welcome/_welcome.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/better-click-to-tweet/includes/views/welcome/_grow.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/better-click-to-tweet/includes/views/welcome/_content.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/better-click-to-tweet/bctt-welcome.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/better-click-to-tweet/includes/views/welcome/_done.php:3
    • > PHP Notice
      Undefined variable: mce_locale in wp-content/plugins/better-click-to-tweet/assets/tinymce/languages/bctt-mce-locale.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bctt_get_step() in wp-content/plugins/better-click-to-tweet/includes/views/welcome/_footer.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_js() in wp-content/plugins/better-click-to-tweet/assets/tinymce/languages/bctt-mce-locale.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-click-to-tweet/admin-nags.php:101

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% 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
Attributes that need to be fixed: Please take inspiration from this readme.txt

better-click-to-tweet/better-click-to-tweet.php Passed 13 tests

The principal PHP file in "Better Click To Tweet" v. 5.12.0 is loaded by WordPress automatically on each request
117 characters long description:
Add Click to Tweet boxes simply and elegantly to your posts or pages. All the features of a premium plugin, for FREE!

Code Analysis Passed 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 plugin3,350 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP235745911,844
PO File82473001,111
CSS6231218
JavaScript62841177

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity28.60
▷ Minimum class complexity3.00
▷ Maximum class complexity92.00
Average method complexity4.29
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods42
▷ Static methods49.52%
▷ Public methods2764.29%
▷ Protected methods00.00%
▷ Private methods1535.71%
Functions39
▷ Named functions3897.44%
▷ Anonymous functions12.56%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.13MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/bctt-logo-alt.png55.11KB17.10KB▼ 68.97%
assets/img/premium_style.png68.47KB27.52KB▼ 59.80%
assets/img/birdy_button.png1.22KB0.51KB▼ 57.91%
assets/img/bctt-logo.png10.56KB5.16KB▼ 51.10%
assets/img/birdy.png1.34KB0.54KB▼ 59.65%