83% buddypress-twitter-post

Code Review | Buddypress Twitter Post

WordPress plugin Buddypress Twitter Post scored83%from 54 tests.

About plugin

  • Plugin page: buddypress-twitte...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: WP 4.9.8, BuddyPress 1.5-4.9.8
  • WordPress version: 6.3.1
  • First release: Jun 19, 2015
  • Latest release: Oct 25, 2018
  • Number of updates: 9
  • Update frequency: every 136.1 days
  • Top authors: gauravbittu278 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,525 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.33ms] Passed 4 tests

A check of server-side resources used by Buddypress Twitter Post
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.89 ▼0.95
Dashboard /wp-admin3.31 ▲0.0047.45 ▼4.74
Posts /wp-admin/edit.php3.36 ▲0.0050.06 ▼1.85
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.40 ▼9.78
Media Library /wp-admin/upload.php3.23 ▲0.0039.23 ▲3.25

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Buddypress Twitter Post
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.24 ▼0.141.85 ▲0.1042.10 ▼4.11
Dashboard /wp-admin2,192 ▲125.59 ▼0.0393.88 ▲1.1340.36 ▼2.90
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0537.41 ▼5.5334.18 ▼3.63
Add New Post /wp-admin/post-new.php1,526 ▼021.47 ▼1.65663.58 ▼37.4571.47 ▲18.54
Media Library /wp-admin/upload.php1,403 ▲64.17 ▼0.1297.98 ▼4.7042.31 ▼2.91

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'BP_TWI_POST_PLUGIN_DIR/includes/twitter-api/src/TwitterOAuths.php' (include_path='.:/usr/share/php') in wp-content/plugins/buddypress-twitter-post/includes/twitter_post_action.php on line 2
    • > PHP Warning
      Use of undefined constant BP_TWI_POST_PLUGIN_DIR - assumed 'BP_TWI_POST_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/buddypress-twitter-post/includes/twitter_setting_action.php on line 2
    • > PHP Warning
      require_once(BP_TWI_POST_PLUGIN_DIR/includes/twitter-api/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/buddypress-twitter-post/includes/twitter_setting_action.php on line 2
    • > PHP Warning
      require_once(BP_TWI_POST_PLUGIN_DIR/includes/twitter-api/src/TwitterOAuths.php): failed to open stream: No such file or directory in wp-content/plugins/buddypress-twitter-post/includes/twitter_post_action.php on line 2
    • > PHP Warning
      Use of undefined constant BP_TWI_POST_PLUGIN_DIR - assumed 'BP_TWI_POST_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/buddypress-twitter-post/includes/twitter_post_action.php on line 2
    • > PHP Warning
      Use of undefined constant BP_TWI_POST_PLUGIN_DIR - assumed 'BP_TWI_POST_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/buddypress-twitter-post/includes/twitter-api/src/TwitterOAuths.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required 'BP_TWI_POST_PLUGIN_DIR/includes/twitter-api/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/buddypress-twitter-post/includes/twitter_setting_action.php on line 2
    • > PHP Warning
      require_once(BP_TWI_POST_PLUGIN_DIR/includes/twitter-api/src/Exception/TwitterException.php): failed to open stream: No such file or directory in wp-content/plugins/buddypress-twitter-post/includes/twitter-api/src/TwitterOAuths.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\SignatureMethod' not found in wp-content/plugins/buddypress-twitter-post/includes/twitter-api/src/HmacSha1.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Abraham\\TwitterOAuth\\Config' not found in wp-content/plugins/buddypress-twitter-post/includes/twitter-api/src/TwitterOAuth.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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: These screenshots do not have images: #1 (My Twitter link), #2 (Twitter key setting), #3 (Post on twitter)
Please take inspiration from this readme.txt

buddypress-twitter-post/buddypress_twitter_post.php 85% from 13 tests

The entry point to "Buddypress Twitter Post" version 1.0.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("buddypress-twitter-post.php" instead of "buddypress_twitter_post.php")
  • Requires at least: Please use periods and digits for the required version (ex. "7.0" instead of "WP 4.9.8, BuddyPress 1.5")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin5,675 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS11114,347
PHP212617771,328

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity12.38
▷ Minimum class complexity1.00
▷ Maximum class complexity89.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods101
▷ Static methods76.93%
▷ Public methods7372.28%
▷ Protected methods00.00%
▷ Private methods2827.72%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants10
▷ Global constants660.00%
▷ Class constants440.00%
▷ Public constants4100.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
3 PNG files occupy 0.23MB with 0.13MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png80.73KB35.42KB▼ 56.12%
screenshot-1.png79.26KB36.20KB▼ 54.33%
screenshot-3.png75.40KB33.35KB▼ 55.77%