10% pb-tweet

Code Review | PB-Tweet

WordPress plugin PB-Tweet scored10%from 54 tests.

About plugin

  • Plugin page: pb-tweet
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9.0-3.5
  • WordPress version: 6.3.1
  • First release: Jun 22, 2010
  • Latest release: Aug 21, 2013
  • Number of updates: 16
  • Update frequency: every 87.4 days
  • Top authors: mattdanner (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /15,007 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/pb-tweet/tweetbuddy.php+26
    Methods with the same name as their class will not be constructors in a future version of PHP; PBTweetBuddy has a deprecated constructor

Server metrics [RAM: ▼1.83MB] [CPU: ▼54.61ms] Passed 4 tests

An overview of server-side resources used by PB-Tweet
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.304.88 ▼33.95
Dashboard /wp-admin2.18 ▼1.166.03 ▼53.64
Posts /wp-admin/edit.php2.19 ▼1.176.28 ▼42.95
Add New Post /wp-admin/post-new.php2.19 ▼3.706.84 ▼87.89
Media Library /wp-admin/upload.php2.19 ▼1.045.87 ▼28.65
pbTweet /wp-admin/options-general.php?page=pb-tweetbuddy-settings2.197.10

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for PB-Tweet
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.65 ▼0.931.79 ▼0.0239.86 ▼4.71
Dashboard /wp-admin2,213 ▲224.85 ▼1.0098.30 ▼13.3741.24 ▼2.83
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0436.91 ▼0.3035.27 ▼2.01
Add New Post /wp-admin/post-new.php1,535 ▼723.08 ▲4.72680.34 ▲35.6159.64 ▼0.10
Media Library /wp-admin/upload.php1,392 ▲74.23 ▲0.0896.89 ▼5.5642.72 ▼1.62
pbTweet /wp-admin/options-general.php?page=pb-tweetbuddy-settings8051.7026.5725.12

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/pb-tweet/tweetbuddy.php+26
    Methods with the same name as their class will not be constructors in a future version of PHP; PBTweetBuddy has a deprecated constructor
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=pb-tweetbuddy-settings
    • > Deprecated in wp-content/plugins/pb-tweet/tweetbuddy.php+26
    Methods with the same name as their class will not be constructors in a future version of PHP; PBTweetBuddy has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=pb-tweetbuddy-settings
    • > Notice in wp-content/plugins/pb-tweet/tweetbuddy.php+56
    Only variables should be passed by reference

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
The following issues need your attention
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/pb-tweet/tweetbuddy.php:52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function auth_redirect() in wp-content/plugins/pb-tweet/lib/updater/get.php:10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/pb-tweet/lib/updater/updater.php:237
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/pb-tweet/tweetbuddy.php on line 51

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/options-general.php?page=pb-tweetbuddy-settings
    • > Javascript (severe) in unknown
    /wp-content/plugins/pb-tweet/js/tooltip.js?ver=6.3.1 13:62 Uncaught TypeError: Cannot read properties of undefined (reading 'msie')
    • > GET request to /wp-admin/options-general.php?page=pb-tweetbuddy-settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).tooltip is not a function" "TypeError: jQuery(...).tooltip is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/pb-tweet/js/admin.js?ver=6.3.1:2:25)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=pb-tweetbuddy-settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).tooltip is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === pb-tweet === )
Please take inspiration from this readme.txt

pb-tweet/tweetbuddy.php 92% from 13 tests

The main file in "PB-Tweet" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("pb-tweet.php" instead of "tweetbuddy.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected560 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP3120108512
CSS20033
JavaScript201315

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity45.00
▷ Minimum class complexity33.00
▷ Maximum class complexity57.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods32
▷ Static methods00.00%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
4 PNG files occupy 0.38MB with 0.20MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/pluginbuddy.png3.28KB0.71KB▼ 78.24%
screenshot-1.png144.42KB49.35KB▼ 65.83%
lib/updater/key.png0.60KB0.59KB▼ 1.47%
screenshot-2.png239.41KB86.71KB▼ 63.78%