77% templatesnext-onepager

Code Review | TemplatesNext OnePager

WordPress plugin TemplatesNext OnePager scored77%from 54 tests.

About plugin

  • Plugin page: templatesnext-one...
  • Plugin version: 1.3.3
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.7
  • WordPress version: 6.3.1
  • First release: Mar 17, 2017
  • Latest release: Mar 15, 2021
  • Number of updates: 67
  • Update frequency: every 21.7 days
  • Top authors: marsian (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /34,406 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲3.51MB] [CPU: ▲9.13ms] Passed 4 tests

An overview of server-side resources used by TemplatesNext OnePager
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /8.17 ▲4.7164.64 ▲16.15
Dashboard /wp-admin6.95 ▲3.6479.84 ▲14.23
Posts /wp-admin/edit.php7.01 ▲3.6573.85 ▲18.34
Add New Post /wp-admin/post-new.php8.94 ▲3.06109.74 ▼12.19
Media Library /wp-admin/upload.php6.91 ▲3.6878.11 ▲35.02
Welcome to Meta Box /wp-admin/index.php?page=meta-box-about6.9758.76

Server storage [IO: ▲11.59MB] [DB: ▲0.24MB] 67% from 3 tests

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • You have illegally modified 1 file (0.61KB) outside of "wp-content/plugins/templatesnext-onepager/" and "wp-content/uploads/"
    • (new file) wp-content/themes/twentytwentyone/txo-onepager.php
Filesystem: 698 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by TemplatesNext OnePager
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,130 ▲36913.86 ▼0.4222.99 ▲20.9847.70 ▼4.44
Dashboard /wp-admin2,201 ▲275.53 ▼0.14107.00 ▼1.2346.40 ▼16.73
Posts /wp-admin/edit.php2,109 ▲62.02 ▼0.0143.52 ▼1.0339.83 ▲1.71
Add New Post /wp-admin/post-new.php1,416 ▼11017.78 ▼5.15836.63 ▲86.0057.21 ▲2.34
Media Library /wp-admin/upload.php1,403 ▲34.25 ▲0.12129.24 ▼20.5049.89 ▼17.08
Welcome to Meta Box /wp-admin/index.php?page=meta-box-about1,7292.0328.0059.88

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 14× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/templatesnext-onepager/inc/meta-box/inc/templates/video.php
    • > /wp-content/plugins/templatesnext-onepager/templates/home-pricing.php
    • > /wp-content/plugins/templatesnext-onepager/inc/kirki/controls/views/select.php
    • > /wp-content/plugins/templatesnext-onepager/inc/kirki/controls/views/radio.php
    • > /wp-content/plugins/templatesnext-onepager/inc/meta-box/inc/templates/audio.php
    • > /wp-content/plugins/templatesnext-onepager/templates/home-video.php
    • > /wp-content/plugins/templatesnext-onepager/inc/meta-box/inc/templates/media.php
    • > /wp-content/plugins/templatesnext-onepager/inc/meta-box/inc/templates/upload.php
    • > /wp-content/plugins/templatesnext-onepager/inc/meta-box/inc/templates/image-advanced.php
    • > /wp-content/plugins/templatesnext-onepager/inc/kirki/controls/views/number.php
  • 164× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/templatesnext-onepager/inc/kirki/deprecated/filters.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Kirki_Field_Radio' not found in wp-content/plugins/templatesnext-onepager/inc/kirki/field/class-kirki-field-radio-buttonset.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Kirki_Control_Base' not found in wp-content/plugins/templatesnext-onepager/inc/kirki/controls/php/class-kirki-control-background.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Kirki_Output_Property' not found in wp-content/plugins/templatesnext-onepager/inc/kirki/modules/css/property/class-kirki-output-property-background-position.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/templatesnext-onepager/inc/txo-sections.php:60
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Image_Advanced_Field' not found in wp-content/plugins/templatesnext-onepager/inc/meta-box/inc/fields/single-image.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/templatesnext-onepager/templates/home-images.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Kirki_Field' not found in wp-content/plugins/templatesnext-onepager/inc/kirki/field/class-kirki-field-dimensions.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Kirki_Field_Select' not found in wp-content/plugins/templatesnext-onepager/inc/kirki/field/class-kirki-field-dropdown-pages.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Datetime_Field' not found in wp-content/plugins/templatesnext-onepager/inc/meta-box/inc/fields/date.php:11

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (One Page Website), #2 (All Options in Customizer), #3 (Active/Sort sections), #4 (Content Option in customizer), #5 (Highly customizable)
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
You can take inspiration from this readme.txt

templatesnext-onepager/tx-onepager.php 92% from 13 tests

The entry point to "TemplatesNext OnePager" version 1.3.3 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("templatesnext-onepager.php" instead of "tx-onepager.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin69,697 lines of code in 589 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1985,1713,83521,671
PHP2743,83511,39421,331
CSS581,50238412,577
JSON4008,318
SVG33002,919
PO File115145671,384
Markdown232701,028
Sass76694427
YAML17027
XML10015

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.59
▷ Minimum class complexity1.00
▷ Maximum class complexity84.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes207
▷ Abstract classes62.90%
▷ Concrete classes20197.10%
▷ Final classes83.98%
Methods810
▷ Static methods35844.20%
▷ Public methods58772.47%
▷ Protected methods20224.94%
▷ Private methods212.59%
Functions166
▷ Named functions14285.54%
▷ Anonymous functions2414.46%
Constants13
▷ Global constants13100.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
57 compressed PNG files occupy 3.25MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/meta-box/img/jqueryui/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
images/trans-pat-2.png26.86KB28.12KB0.00%
images/portfolio/portfolio4.png50.47KB48.61KB▼ 3.68%
images/curve-up.png1.56KB0.66KB▼ 57.72%
css/tx/images/loading_background.png0.13KB0.15KB0.00%