Make WordPress Core

Opened 5 years ago

Closed 8 months ago

#51507 closed defect (bug) (wontfix)

Ability to use as a framework

Reported by: ttodua's profile ttodua Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Bootstrap/Load Keywords:
Focuses: Cc:

Description

WordPress provides more than 600+ framework-like functions (get_option/set_option, transcients, sanitize-functions and more, which are seen in test).
I doubt that there may be other people like our company, where we use WordPress as a backend helper framework, to make use of it's goodies (hundreds of useful functions).

As speed & performance matter, people has asked for this feature many times (i.e. example1 or example2)

It might be some useful to have one additional alternative for "SHORTINIT" constant:

  • SHORTINIT_WITHOUT_DB (to return from "wp-settings.php" right before require_wp_db())

# Performance gains #
Per my tests, compared to SHORTINIT, this approach loads wp-core about 10x faster (avoiding DB calls, etc).

Attaching the patches.

Attachments (2)

51507-1.patch (982 bytes) - added by ttodua 5 years ago.
51507-2.patch (1.8 KB) - added by ttodua 15 months ago.

Download all attachments as: .zip

Change History (7)

#1 @ttodua
5 years ago

To test simply:

$x= microtime(true);
define('SHORTINIT_WITHOUT_DB', true);  //as opposed to define('SHORTINIT', true); 
require(__DIR__."/src/wp-load.php");
var_dump(  microtime(true)- $x );
Last edited 15 months ago by ttodua (previous) (diff)

@ttodua
5 years ago

#2 @sabernhardt
5 years ago

  • Component changed from General to Bootstrap/Load

Related: #41783

@ttodua
15 months ago

#3 @jorbin
9 months ago

  • Keywords 2nd-opinion close added
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

This doesn't feel like it fits the current goals of WordPress as a project. SHORTINIT is already undertested, adding a new constant that adds yet another consideration for how files are loaded will make it harder to change the load process. I suggest that this is closed as wontfix.

#4 @jorbin
9 months ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Meant to leave it open for discussion (hence the 2nd-opion keyword), so reopening.

#5 @desrosj
8 months ago

  • Keywords 2nd-opinion close removed
  • Resolution set to wontfix
  • Status changed from reopened to closed

Thanks for this suggestion @ttodua! However, I agree with @jorbin's assessment above, so I'm going to close this one out.

Discussion can always continue on closed tickets, and they can be reopened in the future should conditions change.

Note: See TracTickets for help on using tickets.