77% twitteronlyforyou

Code Review | Twitter Only For You

WordPress plugin Twitter Only For You scored77%from 54 tests.

About plugin

  • Plugin page: twitteronlyforyou
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 6.3.1
  • First release: Nov 18, 2014
  • Latest release: Nov 18, 2014
  • Number of updates: 3
  • Update frequency: every 13.0 days
  • Top authors: jboghani (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,010 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
Install script ran successfully

Server metrics [RAM: ▼0.20MB] [CPU: ▼16.52ms] Passed 4 tests

Server-side resources used by Twitter Only For You
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.80 ▼0.6618.18 ▼21.02
Dashboard /wp-admin3.34 ▼0.0041.64 ▼15.06
Posts /wp-admin/edit.php3.17 ▼0.1924.13 ▼26.17
Add New Post /wp-admin/post-new.php5.92 ▲0.0489.52 ▼3.84
Media Library /wp-admin/upload.php3.26 ▲0.0435.45 ▲1.13

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Twitter Only For You
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,450 ▼33614.30 ▼0.260.59 ▼1.330.09 ▼40.42
Dashboard /wp-admin2,214 ▲375.82 ▲0.2483.06 ▼5.4479.69 ▲35.06
Posts /wp-admin/edit.php27 ▼2,0730.42 ▼1.540.06 ▼38.250.11 ▼36.36
Add New Post /wp-admin/post-new.php1,696 ▲16822.19 ▼0.69720.61 ▲34.8570.21 ▲5.37
Media Library /wp-admin/upload.php1,419 ▲224.09 ▼0.0699.91 ▲3.9370.61 ▲27.01

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • 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
Good news, no errors were detected

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
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/twitteronlyforyou/twitter/callback.php
    • > /wp-content/plugins/twitteronlyforyou/twitter/connect.php
  • 24× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant OAUTH_CALLBACK - assumed 'OAUTH_CALLBACK' (this will throw an Error in a future version of PHP) in wp-content/plugins/twitteronlyforyou/twitter/connect.php on line 9
    • > PHP Warning
      Use of undefined constant CONSUMER_KEY - assumed 'CONSUMER_KEY' (this will throw an Error in a future version of PHP) in wp-content/plugins/twitteronlyforyou/twitter/connect.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/twitteronlyforyou/main.php:15
    • > PHP Notice
      Undefined index: oauth_token_secret in wp-content/plugins/twitteronlyforyou/twitter/twitteroauth/twitteroauth.php on line 77
    • > PHP Notice
      Undefined variable: _SESSION in wp-content/plugins/twitteronlyforyou/twitter/callback.php on line 7
    • > PHP Notice
      Undefined index: oauth_verifier in wp-content/plugins/twitteronlyforyou/twitter/callback.php on line 9
    • > PHP Warning
      Use of undefined constant CONSUMER_SECRET - assumed 'CONSUMER_SECRET' (this will throw an Error in a future version of PHP) in wp-content/plugins/twitteronlyforyou/twitter/connect.php on line 7
    • > PHP Notice
      Undefined index: oauth_token in wp-content/plugins/twitteronlyforyou/twitter/connect.php on line 10
    • > PHP Notice
      Undefined index: oauth_token in wp-content/plugins/twitteronlyforyou/twitter/twitteroauth/twitteroauth.php on line 111
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/twitteronlyforyou/twitter/callback.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Admin: Configuration twitter.), #2 (Front: Login button on Login Form)
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

twitteronlyforyou/main.php 85% from 13 tests

The main PHP file in "Twitter Only For You" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this 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 ("twitteronlyforyou.php" instead of "main.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected965 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP10190348878
JavaScript226049
CSS20638

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.38
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes215.38%
▷ Concrete classes1184.62%
▷ Final classes00.00%
Methods78
▷ Static methods1012.82%
▷ Public methods6785.90%
▷ Protected methods22.56%
▷ Private methods911.54%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/lighter.png4.29KB2.16KB▼ 49.73%