74% tweetbutton-for-wordpress

Code Review | TweetButton

WordPress plugin TweetButton scored74%from 54 tests.

About plugin

  • Plugin page: tweetbutton-for-w...
  • Plugin version: 3.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.5.2
  • WordPress version: 6.3.1
  • First release: Aug 13, 2010
  • Latest release: May 27, 2016
  • Number of updates: 71
  • Update frequency: every 29.8 days
  • Top authors: dcgws (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /10,592 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.90MB] [CPU: ▼33.51ms] Passed 4 tests

An overview of server-side resources used by TweetButton
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.07 ▼3.96
Dashboard /wp-admin3.04 ▼0.2626.12 ▼23.83
Posts /wp-admin/edit.php3.04 ▼0.3122.15 ▼28.54
Add New Post /wp-admin/post-new.php3.04 ▼2.8423.43 ▼74.04
Media Library /wp-admin/upload.php3.04 ▼0.1828.05 ▼7.64

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 17 new options
New WordPress options
widget_recent-posts
tb_display_page
widget_theysaidso_widget
tb_rss_where
theysaidso_admin_options
tb_style
tb_hashtag
tb_ping
tb_lang
tb_where
...

Browser metrics Passed 4 tests

TweetButton: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲4413.24 ▼1.511.65 ▼0.9337.79 ▼4.86
Dashboard /wp-admin2,221 ▲184.98 ▲0.11112.50 ▼9.3482.61 ▲35.87
Posts /wp-admin/edit.php2,121 ▲211.97 ▼0.0038.77 ▼1.5933.90 ▼3.92
Add New Post /wp-admin/post-new.php1,693 ▲14822.50 ▼0.73789.96 ▲160.8159.34 ▲0.67
Media Library /wp-admin/upload.php1,412 ▲124.13 ▼0.07110.37 ▲0.7973.78 ▲28.79

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin does not fully uninstall, leaving 17 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • tb_rss_where
    • tb_via
    • tb_display_rss
    • tb_related
    • tb_ping
    • tb_display_page
    • tb_lang
    • tb_where
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/tweetbutton-for-wordpress/tweetbutton.php:308

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 on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (TweetButton Settings Page), #2 (TweetButton)
You can take inspiration from this readme.txt

tweetbutton-for-wordpress/tweetbutton.php 92% from 13 tests

The main file in "TweetButton" v. 3.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("tweetbutton-for-wordpress.php" instead of "tweetbutton.php")

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
Success! There were no dangerous files found in this plugin266 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11452266

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.44MB with 0.42MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
tweetbutton-icon.png47.05KB0.44KB▼ 99.06%
screenshot-2.png51.06KB1.11KB▼ 97.82%
images/tweet.png52.77KB0.84KB▼ 98.40%
screenshot-1.png298.21KB47.37KB▼ 84.12%