78% tweetthis-shortcode

Code Review | TweetThis Shortcode

WordPress plugin TweetThis Shortcode scored78%from 54 tests.

About plugin

  • Plugin page: tweetthis-shortcode
  • Plugin version: 1.8.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9
  • WordPress version: 6.3.1
  • First release: Oct 23, 2015
  • Latest release: Nov 19, 2017
  • Number of updates: 45
  • Update frequency: every 16.9 days
  • Top authors: douglaskarr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /8,189 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.04ms] Passed 4 tests

A check of server-side resources used by TweetThis Shortcode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.90 ▼3.25
Dashboard /wp-admin3.34 ▼0.0063.19 ▲1.94
Posts /wp-admin/edit.php3.39 ▲0.0449.28 ▲5.69
Add New Post /wp-admin/post-new.php5.92 ▲0.0491.09 ▼3.28
Media Library /wp-admin/upload.php3.27 ▲0.0433.59 ▲0.44
TweetThis Shortcode /wp-admin/options-general.php?page=tweetthis_shortcode3.2133.21

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for TweetThis Shortcode
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6813.37 ▼0.971.54 ▼0.2938.14 ▼7.32
Dashboard /wp-admin2,214 ▲264.87 ▼0.00100.02 ▼15.8239.12 ▼9.01
Posts /wp-admin/edit.php2,097 ▲81.98 ▼0.0540.53 ▲4.5234.96 ▲0.99
Add New Post /wp-admin/post-new.php1,521 ▼1217.66 ▼5.44703.24 ▲28.3161.94 ▲10.64
Media Library /wp-admin/upload.php1,399 ▲84.20 ▲0.0198.36 ▼1.6042.98 ▼0.53
TweetThis Shortcode /wp-admin/options-general.php?page=tweetthis_shortcode8782.1524.5630.38

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% 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
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=tweetthis_shortcode
    • > Notice in wp-content/plugins/tweetthis-shortcode/dkts.php+193
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=tweetthis_shortcode
    • > Notice in wp-content/plugins/tweetthis-shortcode/dkts.php+182
    Trying to get property 'ID' of non-object
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=tweetthis_shortcode
    • > Notice in wp-content/plugins/tweetthis-shortcode/dkts.php+239
    Undefined variable: dkts_twitter
    • > GET request to /wp-admin/options-general.php?page=tweetthis_shortcode
    • > Notice in wp-content/plugins/tweetthis-shortcode/dkts.php+221
    Undefined variable: hashtag

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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tweetthis-shortcode/dkts.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (View of the shortcode and output link created.), #2 (View of a report section with the posts and Bit.ly reporting links.)
The official readme.txt might help

tweetthis-shortcode/dkts.php 92% from 13 tests

The main PHP file in "TweetThis Shortcode" ver. 1.8.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("tweetthis-shortcode.php" instead of "dkts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin198 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14233198

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
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%
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

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.03MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png9.21KB9.66KB0.00%
screenshot-2.png21.49KB23.14KB0.00%