78% twitter-account-box

Code Review | Twitter Account Box aka TAB

WordPress plugin Twitter Account Box aka TAB scored78%from 54 tests.

About plugin

  • Plugin page: twitter-account-box
  • Plugin version: 0.2.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-4.3
  • WordPress version: 6.3.1
  • First release: Jun 13, 2014
  • Latest release: Aug 20, 2015
  • Number of updates: 36
  • Update frequency: every 18.8 days
  • Top authors: 0is1 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,540 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

Analyzing server-side resources used by Twitter Account Box aka TAB
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.53 ▼4.86
Dashboard /wp-admin3.33 ▲0.0346.66 ▼4.80
Posts /wp-admin/edit.php3.45 ▲0.0948.29 ▲0.49
Add New Post /wp-admin/post-new.php5.91 ▲0.0392.35 ▲9.31
Media Library /wp-admin/upload.php3.26 ▲0.0335.62 ▲4.67
Twitter Account Box /wp-admin/options-general.php?page=twitteraccountbox3.2231.66

Server storage [IO: ▲0.95MB] [DB: ▲0.31MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 65 new files
Database: no new tables, 7 new options
New WordPress options
widget_twitteraccountbox_widget
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Twitter Account Box aka TAB
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,898 ▲14113.95 ▼0.4229.09 ▲27.0042.16 ▼2.65
Dashboard /wp-admin2,214 ▲294.84 ▼1.02109.27 ▼11.2142.17 ▼4.18
Posts /wp-admin/edit.php2,097 ▲82.02 ▼0.0139.09 ▲1.1634.38 ▲0.63
Add New Post /wp-admin/post-new.php1,533 ▲1318.34 ▼5.33638.62 ▼12.8179.04 ▲11.41
Media Library /wp-admin/upload.php1,390 ▲24.28 ▲0.1192.68 ▼0.6240.49 ▲1.28
Twitter Account Box /wp-admin/options-general.php?page=twitteraccountbox9092.0327.8043.94

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_twitteraccountbox_widget
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/twitter-account-box/includes/vendor/twitter/index.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/twitter-account-box/public/class-twitter-account-box-widget.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% 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 require attention:
  • Screenshots: These screenshots do not have images: #1 (Admin panel settings), #2 (Twitter Account Box in action), #3 (Go to dev.twitter.com and click "Developers -> Documentation"), #4 (Click "Manage My Apps"), #5 (Click "Create New App"), #6 (Create Twitter App), #7 (Go to "API-keys" page and click "Create Access Token"), #8 (Get key, token and secrets)
The official readme.txt is a good inspiration

twitter-account-box/twitter-account-box.php Passed 13 tests

"Twitter Account Box aka TAB" version 0.2.12's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
73 characters long description:
This plugin adds your Twitter account details box in your Wordpress site.

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
Good job! No executable or dangerous file extensions detected1,967 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP10144386745
HTML240537
CSS134690276
PO File284100176
JSON300116
Markdown231081
SVG20035
JavaScript1061

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity12.33
▷ Minimum class complexity3.00
▷ Maximum class complexity24.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods47
▷ Static methods1531.91%
▷ Public methods3574.47%
▷ Protected methods00.00%
▷ Private methods1225.53%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.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
11 PNG files occupy 0.75MB with 0.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png74.52KB24.55KB▼ 67.06%
screenshot-2.png147.40KB145.45KB▼ 1.32%
public/images/twitteraccountbox-example.png83.42KB84.01KB0.00%
screenshot-4.png130.22KB130.09KB0.10%
public/images/empty_image.png1.77KB0.31KB▼ 82.32%