10% right-intel

Code Review | Sharpr

WordPress plugin Sharpr scored10%from 54 tests.

About plugin

  • Plugin page: right-intel
  • Plugin version: 4.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.6
  • WordPress version: 6.3.1
  • First release: Jan 9, 2015
  • Latest release: Sep 12, 2016
  • Number of updates: 19
  • Update frequency: every 32.2 days
  • Top authors: kendsnyder (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /994 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
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/right-intel/libs/Ri/Thumbnails.php+9
    Non-static method Ri_Post::hasAnyRightIntelPosts() should not be called statically

Server metrics [RAM: ▲0.11MB] [CPU: ▼5.69ms] Passed 4 tests

This is a short check of server-side resources used by Sharpr
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.1039.27 ▲1.89
Dashboard /wp-admin3.42 ▲0.1142.47 ▼2.12
Posts /wp-admin/edit.php3.45 ▲0.1043.87 ▲1.77
Add New Post /wp-admin/post-new.php6.13 ▲0.2474.74 ▼21.50
Media Library /wp-admin/upload.php3.35 ▲0.1334.69 ▼0.91
Sharpr /wp-admin/options.php?page=sharpr_disconnect_account3.3029.78
Sharpr /wp-admin/options.php?page=sharpr_post_preview3.3032.10
Sharpr /wp-admin/options-general.php?page=sharpr_settings3.2528.10

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 58 new files
Database: 1 new table, 16 new options
New tables
wp_ri_credentials
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
right_intel_styling_bubble_type
right_intel_semver
right_intel_version
right_intel_thumbnails_v3_8
theysaidso_admin_options
right_intel_styling_use_oswald
can_compress_scripts
...

Browser metrics Passed 4 tests

A check of browser resources used by Sharpr
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲8513.23 ▼1.144.41 ▲2.7844.53 ▲1.93
Dashboard /wp-admin2,218 ▲335.86 ▼0.03106.79 ▼4.9539.58 ▼0.61
Posts /wp-admin/edit.php2,101 ▲122.05 ▲0.0538.67 ▼0.0540.39 ▲7.83
Add New Post /wp-admin/post-new.php1,525 ▼923.73 ▲0.54681.26 ▼0.2269.79 ▲13.93
Media Library /wp-admin/upload.php1,400 ▲124.23 ▼0.1696.94 ▼7.5842.29 ▼6.53
Sharpr /wp-admin/options.php?page=sharpr_disconnect_account1,0431.6926.0531.60
Sharpr /wp-admin/options.php?page=sharpr_post_preview500.440.0918.55
Sharpr /wp-admin/options-general.php?page=sharpr_settings1,0461.7622.9632.92

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 16 options
    • can_compress_scripts
    • right_intel_styling_color_text
    • right_intel_semver
    • db_upgraded
    • right_intel_styling_image_display_type
    • right_intel_styling_use_oswald
    • right_intel_thumbnails_v3_8
    • right_intel_styling_bubble_type
    • right_intel_styling_color_bubble
    • right_intel_styling_image_float
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options.php?page=sharpr_disconnect_account
    • > Notice in wp-content/plugins/right-intel/pages/controllers/disconnect_account.php+3
    Undefined index: account_id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=sharpr_settings
    • > Notice in wp-content/plugins/right-intel/pages/controllers/list_accounts.php+4
    Undefined index: connected
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=sharpr_settings
    • > Notice in wp-content/plugins/right-intel/pages/controllers/list_accounts.php+5
    Undefined index: disconnected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/right-intel/pages/views/regenerate_thumbnails.tpl.php
    • > /wp-content/plugins/right-intel/css/dynamic.css.php
  • 22× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Ri_Rest' not found in wp-content/plugins/right-intel/endpoints/get_publish_options.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Ri_Rest' not found in wp-content/plugins/right-intel/endpoints/receiver.php:3
    • > PHP Notice
      Undefined variable: validInstall in wp-content/plugins/right-intel/pages/views/list_accounts.tpl.php on line 74
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/right-intel/right-intel.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/right-intel/pages/controllers/post_preview.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Ri_Thumbnails' not found in wp-content/plugins/right-intel/pages/controllers/regenerate_thumbnails.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Ri_Rest' not found in wp-content/plugins/right-intel/endpoints/connect_account.php:3
    • > PHP Notice
      Undefined variable: postIds in wp-content/plugins/right-intel/pages/views/regenerate_thumbnails.tpl.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Ri_Thumbnails' not found in wp-content/plugins/right-intel/pages/controllers/regenerate_thumbnail_by_id.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Ri_Rest' not found in wp-content/plugins/right-intel/endpoints/disconnect_account_remote.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/options.php?page=sharpr_post_preview
    • > Network (severe)
    https://sharpr.com/blog-bubble.php?color=f26522 - Failed to load resource: the server responded with a status of 500 ()

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (How Sharpr posts look on a WordPress blog.), #2 (Go to the Settings > Sharpr page to connect your blog to Sharpr.), #3 (On the hub dashboard, hover over the gear icon next to a post and click "Send to blog...".), #4 (Before the post is sent to WordPress you can edit the title, insight bubble text, description and assign WordPress categories and tags. Other WordPress options such as author and publish date are available as well.)
The official readme.txt is a good inspiration

right-intel/index.php 92% from 13 tests

The entry point to "Sharpr" version 4.4.2 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("right-intel.php" instead of "index.php")

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
There were no executable files found in this plugin3,467 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP313204802,665
SVG200568
CSS801200
JavaScript10134

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity17.42
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods104
▷ Static methods5048.08%
▷ Public methods10298.08%
▷ Protected methods21.92%
▷ Private methods00.00%
Functions65
▷ Named functions4670.77%
▷ Anonymous functions1929.23%
Constants12
▷ Global constants541.67%
▷ Class constants758.33%
▷ Public constants7100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 1.10MB with 0.55MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png290.63KB81.31KB▼ 72.02%
img/logo-small.png3.25KB2.22KB▼ 31.47%
img/logo-r-16.png0.73KB0.71KB▼ 3.86%
screenshot-2.png272.73KB74.13KB▼ 72.82%
screenshot-4.png256.27KB79.10KB▼ 69.13%