10% wp-pat-twitter

Code Review | WP-PAT-Twitter Facilitator Plugin

WordPress plugin WP-PAT-Twitter Facilitator Plugin scored10%from 54 tests.

About plugin

  • Plugin page: wp-pat-twitter
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.2-3.9.1
  • WordPress version: 6.3.1
  • First release: May 29, 2014
  • Latest release: May 30, 2014
  • Number of updates: 12
  • Update frequency: every 0.8 days
  • Top authors: meitar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /675 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'WP_PAT_Twitter' does not have a method 'activate'

Server metrics [RAM: ▲0.33MB] [CPU: ▼11.30ms] Passed 4 tests

Server-side resources used by WP-PAT-Twitter Facilitator Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.09 ▲0.6243.62 ▲0.34
Dashboard /wp-admin4.01 ▲0.7158.57 ▲8.20
Posts /wp-admin/edit.php4.06 ▲0.7055.02 ▲1.00
Add New Post /wp-admin/post-new.php5.24 ▼0.6548.67 ▼51.18
Media Library /wp-admin/upload.php3.87 ▲0.6444.07 ▲4.63
PAT Twitter Settings /wp-admin/options-general.php?page=wp-patt_settings3.8238.05
Install PAT Twitter /wp-admin/tools.php?page=wp-patt_download_userscript3.8438.32

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WP-PAT-Twitter Facilitator Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.10 ▼0.271.87 ▲0.1943.06 ▼2.45
Dashboard /wp-admin2,197 ▲235.58 ▼0.0286.88 ▼14.7036.60 ▼4.17
Posts /wp-admin/edit.php2,108 ▲82.01 ▲0.0334.66 ▼1.9637.37 ▲4.78
Add New Post /wp-admin/post-new.php1,532 ▼322.94 ▲4.62657.26 ▼8.3457.81 ▼10.58
Media Library /wp-admin/upload.php1,405 ▲54.24 ▼0.01106.79 ▼6.2244.95 ▼4.49
PAT Twitter Settings /wp-admin/options-general.php?page=wp-patt_settings8761.9623.8727.49
Install PAT Twitter /wp-admin/tools.php?page=wp-patt_download_userscript7671.9924.3623.80

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-patt_settings
    • > Notice in wp-content/plugins/wp-pat-twitter/wp-pat-twitter.php+371
    Trying to access array offset on value of type bool

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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-pat-twitter/wp-pat-twitter.php:16

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (After installing Predator Alert Tool for Twitter, create and paste your Twitter API key and secret into its settings screen.) image required
You can take inspiration from this readme.txt

wp-pat-twitter/wp-pat-twitter.php 85% from 13 tests

The primary PHP file in "WP-PAT-Twitter Facilitator Plugin" version 0.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 499 characters long)
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin11,218 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript211,9114,4486,961
PHP71951,5193,484
JSON3290272
Markdown3650235
CSS1435222
HTML2141139
make1205

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 129)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity126.38
▷ Minimum class complexity1.00
▷ Maximum class complexity621.00
Average method complexity11.34
▷ Minimum method complexity1.00
▷ Maximum method complexity129.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes337.50%
▷ Concrete classes562.50%
▷ Final classes00.00%
Methods99
▷ Static methods00.00%
▷ Public methods8888.89%
▷ Protected methods22.02%
▷ Private methods99.09%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png80.95KB26.92KB▼ 66.75%