94% t2-export-for-specific-pages

Code Review | T2 Export

WordPress plugin T2 Export scored 94% from 54 tests.

About plugin

  • Plugin page: t2-export-for-spe...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-3.7
  • WordPress version: 5.8.1
  • First release: Feb 14, 2014
  • Latest release: Feb 14, 2014
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: ThemeTon (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active / 863 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼147.20ms] Passed 4 tests

A check of server-side resources used by T2 Export
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0133.67 ▼1.05
Dashboard /wp-admin3.07 ▲0.0147.92 ▲8.05
Posts /wp-admin/edit.php3.12 ▲0.0144.19 ▲0.38
Add New Post /wp-admin/post-new.php5.43 ▼0.0094.87 ▼582.02
Media Library /wp-admin/upload.php3.01 ▲0.0031.96 ▼6.10

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 20 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

T2 Export: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,699 ▲10316.28 ▲0.717.87 ▼1.7046.61 ▲0.45
Dashboard /wp-admin2,990 ▲535.90 ▼0.24133.07 ▼9.13108.72 ▲0.27
Posts /wp-admin/edit.php2,759 ▲202.70 ▼0.0165.70 ▲5.4285.69 ▲1.39
Add New Post /wp-admin/post-new.php1,685 ▼18718.89 ▼0.25382.91 ▲25.77109.91 ▼2.20
Media Library /wp-admin/upload.php1,824 ▲175.03 ▲0.03154.39 ▲9.43114.45 ▼3.87

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 75% 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 no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATH/wp-admin/admin.php' (include_path='.:/usr/share/php') in wp-content/plugins/t2-export-for-specific-pages/form.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/t2-export-for-specific-pages/form.php on line 4
    • > PHP Warning
      require_once(ABSPATH/wp-admin/admin.php): failed to open stream: No such file or directory in wp-content/plugins/t2-export-for-specific-pages/form.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/t2-export-for-specific-pages/index.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Contributors: Contributors not specified
The official readme.txt might help

t2-export-for-specific-pages/index.php 92% from 13 tests

This is the main PHP file of "T2 Export" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("t2-export-for-specific-pages.php" instead of "index.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
There were no executable files found in this plugin3,491 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript45203822,407
CSS312319566
PHP392138363
Markdown124059
Bourne Shell121052
JSON20044

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/select2/select2x2.png0.83KB0.77KB▼ 6.15%
assets/select2/select2.png0.60KB0.99KB0.00%