73% insert-code

Code Review | Insert Code

WordPress plugin Insert Code scored73%from 54 tests.

About plugin

  • Plugin page: insert-code
  • Plugin version: 2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4
  • WordPress version: 6.3.1
  • First release: Sep 25, 2015
  • Latest release: Feb 11, 2016
  • Number of updates: 53
  • Update frequency: every 2.6 days
  • Top authors: rizwanchaudhry (73.58%)BCSWPplugins (28.3%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /5,461 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼1.61ms] Passed 4 tests

A check of server-side resources used by Insert Code
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1044.99 ▼0.88
Dashboard /wp-admin3.41 ▲0.0658.25 ▼7.32
Posts /wp-admin/edit.php3.50 ▲0.1455.15 ▲9.14
Add New Post /wp-admin/post-new.php6.00 ▲0.1199.83 ▲1.57
Media Library /wp-admin/upload.php3.33 ▲0.1040.13 ▲0.18
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=insertcode3.3243.08
Settings /wp-admin/edit-tags.php?taxonomy=category&post_type=insertcode&page=insert-code3.1432.85
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=page3.3337.63

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 21 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
category_children
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Insert Code
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲10613.26 ▼1.111.84 ▲0.1641.21 ▼0.41
Dashboard /wp-admin2,253 ▲655.84 ▼0.04100.62 ▼6.7474.22 ▲32.22
Posts /wp-admin/edit.php2,151 ▲652.10 ▲0.0438.75 ▲2.6934.06 ▲1.45
Add New Post /wp-admin/post-new.php6,270 ▲4,75119.07 ▼4.25995.02 ▲346.8468.24 ▲6.20
Media Library /wp-admin/upload.php1,447 ▲654.22 ▼0.05103.90 ▲5.7071.37 ▲28.10
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=insertcode1,5022.2827.8835.74
Settings /wp-admin/edit-tags.php?taxonomy=category&post_type=insertcode&page=insert-code280.440.083.72
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=page1,4992.2828.1133.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • category_children
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/insert-code/dashboard/views/insertcode_sidebar.php
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/insert-code/dashboard/views/dashboard-nodata.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/insert-code/insert-code.php:22
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/insert-code/dashboard/views/settings.php:2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/insert-code/dashboard/views/dashboard-data.php on line 8
    • > PHP Notice
      Trying to get property 'item' of non-object in wp-content/plugins/insert-code/dashboard/views/dashboard-data.php on line 8
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/insert-code/dashboard/views/dashboard-data.php:26
    • > PHP Notice
      Undefined variable: rssPosts in wp-content/plugins/insert-code/dashboard/views/dashboard-data.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_remote_get() in wp-content/plugins/insert-code/dashboard/views/dashboard.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit-tags.php?taxonomy=category&post_type=insertcode&page=insert-code
    • > Network (severe)
    wp-admin/edit-tags.php?taxonomy=category&post_type=insertcode&page=insert-code - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: insert, insert ad code, insert code, add code, code...

insert-code/insert-code.php Passed 13 tests

The principal PHP file in "Insert Code" v. 2.4 is loaded by WordPress automatically on each request
139 characters long description:
Allows you to insert code before or after the content and also allow you to insert code after nth paragraphs of your post or page contents.

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
Good job! No executable or dangerous file extensions detected473 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP69977472
CSS1011

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity43.00
▷ Minimum class complexity43.00
▷ Maximum class complexity43.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
13 PNG files occupy 0.49MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/code-icon.png1.08KB0.63KB▼ 42.16%
assets/screenshot-7.png98.49KB28.38KB▼ 71.18%
img/linkedin.png0.49KB0.38KB▼ 22.55%
img/gplus.png0.45KB0.37KB▼ 18.08%
img/mail.png0.49KB0.49KB0.20%