83% insert-pages

Code Review | Insert Pages

WordPress plugin Insert Pages scored83%from 54 tests.

About plugin

  • Plugin page: insert-pages
  • Plugin version: 3.7.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: Nov 21, 2013
  • Latest release: Apr 25, 2023
  • Number of updates: 198
  • Update frequency: every 17.4 days
  • Top authors: figureone (100%)

Code review

54 tests

User reviews

69 reviews

Install metrics

40,000+ active /765,309 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.29MB] [CPU: ▼3.56ms] Passed 4 tests

Analyzing server-side resources used by Insert Pages
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2837.48 ▼7.99
Dashboard /wp-admin3.63 ▲0.2854.13 ▼10.42
Posts /wp-admin/edit.php3.70 ▲0.3551.47 ▲1.15
Add New Post /wp-admin/post-new.php6.19 ▲0.30105.80 ▲3.03
Media Library /wp-admin/upload.php3.51 ▲0.2840.36 ▲5.29
Insert Pages /wp-admin/options-general.php?page=insert_pages3.4831.90

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 36 new files
Database: no new tables, 8 new options
New WordPress options
wpip_settings
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_ipw
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Insert Pages
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,101 ▲34013.29 ▼1.061.80 ▲0.2243.58 ▲6.75
Dashboard /wp-admin2,479 ▲2994.95 ▼0.92100.68 ▲6.7939.51 ▼0.02
Posts /wp-admin/edit.php2,129 ▲292.39 ▲0.4141.70 ▲8.4034.59 ▼1.94
Add New Post /wp-admin/post-new.php6,225 ▲4,69919.25 ▼4.21882.28 ▲190.7137.85 ▼24.17
Media Library /wp-admin/upload.php1,424 ▲244.55 ▲0.37110.44 ▲1.1346.19 ▲1.09
Insert Pages /wp-admin/options-general.php?page=insert_pages9672.1228.8745.40

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • theysaidso_admin_options
    • widget_ipw
    • wpip_settings
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/insert-pages/options.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/insert-pages/options.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/insert-pages/widget.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Insert Pages toolbar button.), #2 (Insert Pages browser.), #3 (Insert Pages shortcode example.)
The official readme.txt might help

insert-pages/insert-pages.php 92% from 13 tests

"Insert Pages" version 3.7.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 143 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected22,614 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JSON30019,421
PHP52056291,398
JavaScript93212291,376
CSS3684380
XML17720
Sass11419

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 152)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity139.50
▷ Minimum class complexity26.00
▷ Maximum class complexity253.00
Average method complexity12.08
▷ Minimum method complexity1.00
▷ Maximum method complexity152.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods14.00%
▷ Public methods2184.00%
▷ Protected methods14.00%
▷ Private methods312.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.18MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png80.53KB32.53KB▼ 59.60%
screenshot-1.png49.60KB20.63KB▼ 58.42%
img/insertpages_toolbar_icon.png1.29KB0.50KB▼ 61.03%
screenshot-3.png51.93KB19.98KB▼ 61.53%
img/toggle-arrow.png3.15KB0.29KB▼ 90.73%