10% insights

Code Review | Insights

WordPress plugin Insights scored10%from 54 tests.

About plugin

  • Plugin page: insights
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 2.3-4.2
  • WordPress version: 6.3.1
  • First release: Sep 8, 2008
  • Latest release: Dec 22, 2014
  • Number of updates: 28
  • Update frequency: every 82.1 days
  • Top authors: freediver (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

600+ active /148,435 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/insights/insights.php+28
    Methods with the same name as their class will not be constructors in a future version of PHP; WPInsights has a deprecated constructor

Server metrics [RAM: ▼1.90MB] [CPU: ▼54.26ms] Passed 4 tests

This is a short check of server-side resources used by Insights
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.374.92 ▼36.44
Dashboard /wp-admin2.11 ▼1.197.00 ▼44.01
Posts /wp-admin/edit.php2.12 ▼1.255.90 ▼45.18
Add New Post /wp-admin/post-new.php2.11 ▼3.787.92 ▼91.39
Media Library /wp-admin/upload.php2.11 ▼1.124.96 ▼32.56

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
WPInsights_options
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Insights
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.34 ▲0.081.77 ▼0.2643.93 ▲0.57
Dashboard /wp-admin2,196 ▲195.54 ▼0.15104.24 ▲15.4442.87 ▲2.93
Posts /wp-admin/edit.php2,104 ▲11.94 ▼0.0737.87 ▼6.3134.20 ▼2.59
Add New Post /wp-admin/post-new.php6,299 ▲4,77326.05 ▲2.44926.18 ▲261.6058.39 ▲3.00
Media Library /wp-admin/upload.php1,398 ▲14.15 ▼0.0396.56 ▼12.4645.71 ▲0.58
Insights /wp-admin/insights.php260.420.0815.46

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/insights/insights.php+28
    Methods with the same name as their class will not be constructors in a future version of PHP; WPInsights has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • WPInsights_options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/insights/insights.php
    • > /wp-content/plugins/insights/insights-ajax.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: action_url in wp-content/plugins/insights/insights-options.php on line 15
    • > PHP Notice
      Undefined variable: imgpath in wp-content/plugins/insights/insights-options.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/insights/insights-options.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/insights.php
    • > Network (severe)
    wp-admin/insights.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Searching images on Flickr and adding them), #2 (Searching Youtube videos, add to post), #3 (Adding a Google Map!), #4 (Using Wikipedia), #5 (Searching my Blog and linking to a post)
  • Tags: There are too many tags (20 tag instead of maximum 10)
Please take inspiration from this readme.txt

insights/insights.php Passed 13 tests

This is the main PHP file of "Insights" version 1.0.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
120 characters long description:
Insights allows you to quickly search and insert information (links, images, videos, maps, news..) into your blog posts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin732 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript311488381
PHP316441351

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
16 compressed PNG files occupy 0.29MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/edit.png0.63KB0.68KB0.00%
img/help.png0.97KB0.98KB0.00%
screenshot-3.png59.24KB59.38KB0.00%
screenshot-5.png11.81KB11.73KB▼ 0.64%
img/twit.png0.71KB0.80KB0.00%