vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Plugin Accelerator (https://vborg.vbsupport.ru/showthread.php?t=107315)

Trigunflame 02-05-2006 10:00 PM

Plugin Accelerator
 
Vbulletin Plugin Accelerator
Accelerate Your Forums Plugins

https://vborg.vbsupport.ru/


Summary:

If you use the Vbulletin Plugin System (Specially if you use a lot of plugins), this will help improve the performance of the system overall by inlining all of the plugin code into the PHP files themself.

Essentially making it as if you had hacked the files yourself, this will give you better performance on your forum overall.

PS. Use this in conjunction with my Other Hack (Compress Forum Templates) for speeding up your forum even more by compressing templates.
https://vborg.vbsupport.ru/showthread.php?t=107615
PS. Use this in conjunction with my Other Hack (Template Cache System) for speeding up your forum by caching its templates.
https://vborg.vbsupport.ru/showthread.php?t=110144

Install:
  1. Download the zip file.
  2. Open install.txt and Read Instructions

Upgrade:
  1. Download the zip file.
  2. Uninstall Product "Vbulletin Plugin Accelerator"
  3. Open install.txt and Read Instructions to install like usual.

Current Status: (RC2)

Release Candidate 2 Has Been Released.
This code has been deemed acceptable and to be used by all.

Please report any bugs back to this thread.
Thanks.
  • Latest Changes: 02/11/2006
  • Fixed another problem with backslashes, hopefully this will fix some other problems.
  • To upgrade, just replace the includes/class_plugin_accelerator.php with the new one.

Important Notes:

1. While this IS a release candidate, more than likely its not fully bug free so Please backup your files before you install this modification, this system is not yet perfect.

2. When running "Rebuild Hook Cache" and "Rebuild All Plugins" if you ever see a small parse error, or file couldnt be opened error; re-run both again and it should go away.

3. includes/hook_files.php contains locations of all the files the accelerator scans for plugin hooks, if you have any files that have been renamed, moved, etc.. you need to add it to that file on its own line, thanks.


If You Have Problems:

If you incur any parse errors, or pages not displaying after running the steps. Please make a copy of the affect file as well as its original version, zip them and upload somewhere. Send me a link to the file for me to download, review and provide a fix.

bashy 02-06-2006 08:04 PM

Laymans terms please :o lol

Protoman 02-06-2006 08:26 PM

it works!

Trigunflame 02-06-2006 09:06 PM

Quote:

Originally Posted by bashy
Laymans terms please :o lol

If you use a lot of "Plugins" via the Vbulletin Plugin System, this will make your site faster when I get an actual version working.

Andreas 02-06-2006 09:20 PM

Interesting :)
I wrote a little windows application to prepare a "slipstreamed" vBulletin with all Plugins included back in beta stage.

Worked very well, though you loose the flexibility of the Plugin system:
You can't easily enable/disable Plugins/Products through ACP anymore, as this requires reprocessing the files.
And having them +w might not be a too good option, especially in shared environments.

Trigunflame 02-06-2006 09:41 PM

Quote:

Originally Posted by Andreas
Interesting :)
I wrote a little windows application to prepare a "slipstreamed" vBulletin with all Plugins included back in beta stage.

Worked very well, though you loose the flexibility of the Plugin system:
You can't easily enable/disable Plugins/Products through ACP anymore, as this requires reprocessing the files.
And having them +w might not be a too good option, especially in shared environments.

Well this is the thing, you Will be able to easily "enable/disable" the plugins and products from the ACP; this system will not hinder the use of that, I will keep a cache of the hook_name => file pairs, by good use of power of preg via comments I can control where code is placed in the vbulletin files and be able to add and remove plugin code easily (Only) on the needed files, no need to scan the files again for every plugin code change.

As for the chmod options, there is a truth to that; but I can probably write a suitable php implementation that can control the chmod options to a degree when files need to be wrote, then set back to 755.. ofcourse this will defer depending on the system; in the end people can always chmod their files to 777 when they want to make a change, then back to 755 when they finish.

Andreas 02-06-2006 09:54 PM

Yeah, but if I turn Off the Plugin System you will have to re-process all files that contain active Hooks :)

Also, you would have to add a check for DISABLE_HOOKS being set on every Hoook location, or that won't work any longer - which again adds some overhead.

Trigunflame 02-06-2006 09:59 PM

Quote:

Originally Posted by Andreas
Yeah, but if I turn Off the Plugin System you will have to re-process all files that contain active Hooks :)

Also, you would have to add a check for DISABLE_HOOKS being set on every Hoook location, or that won't work any longer - which again adds some overhead.

That is true, but you are talking hypothetically. Realistically no one is going to turn their plugin system on and off several times a day every day. There are lots of plugin hooks, but not all of them are used.. as such not every file has to be modified and not every hook has to be replaced. If the file contains hooks that are not currently used by the system they are simply commented out.

I plan to keep existing compatability; Even if used an if() construct for each plugin segment that still takes less cpu cycles than an empty function call.

Trigunflame 02-07-2006 02:03 AM

Update:

Integrated Test Number 2, this does an actual hook cache, hook replace with php code, output with 2 included example files.

This is a proof of concept attempt, and will be further expanded probably tomorrow.. but this is a good foundation to work from.

No need to worry about modification of your files, this is performed on the 2 test files e_1.php and e_2.php included with the archive.

Zia 02-07-2006 02:50 AM

hello...
im not a coder or a xpert...
in easy way...does it help speed up vb3.5.3 ?????
.i read the description mentioned...:S kinda hard to realize..

it will create another plug in system that will work faster than the defult system?

sorry for this kind of raw qus...but im not a coder or an xpert..
thnx

Trigunflame 02-07-2006 03:12 AM

Quote:

Originally Posted by Zia
hello...
im not a coder or a xpert...
in easy way...does it help speed up vb3.5.3 ?????
.i read the description mentioned...:S kinda hard to realize..

it will create another plug in system that will work faster than the defult system?




sorry for this kind of raw qus...but im not a coder or an xpert..
thnx

This is alpha quality code, we are just in the testing stages; the current code in the archive simply provides 2 tests that you can run to see if the plugin system code will work on your server/forum/site.

We should have "fully" operational code with the next day or so.

Zia 02-07-2006 03:40 AM

Thans let us try with it in our test site ...
:)
thnx

uae 02-07-2006 04:34 AM

Hey thanks,
But there is no file called static_plugins.php in the zip file!

Trigunflame 02-07-2006 04:38 AM

Quote:

Originally Posted by uae
Hey thanks,
But there is no file called static_plugins.php in the zip file!

I renamed it to test.php, sorry I'll update page.

The Realist 02-07-2006 12:18 PM

Re: No4 below, what findings do you want?

Quote:

1) Instructions:
2) Download the zip file.
3) Place the static_plugins folder in your forum directory.
4) Run the script via the url [U]http:// yoursite.com/static_plugins/test.php
5) Report your finding back here if you would please.

Snake 02-07-2006 01:55 PM

/me clicks on the clicky clicky Install button...

Trigunflame 02-07-2006 05:00 PM

Quote:

Originally Posted by The Realist
Re: No4 below, what findings do you want?

Check the results of test 2 to verify that the ($hook = vbxxxxxx ? : false) is replaced with example php code inside comment blocks.

Paul M 02-07-2006 05:13 PM

So let's just make sure I understand this;

This will scan every vbulletin php file for hook calls, and for each one it will ;-

1. If you have no plugins associated with that hook it will just comment it out

2. If you have a plugin that uses it, it will edit the actual file - to copy the code into it.

What happens when I edit/enable/disable plugins ?

Would it not be less dangerous to copy the plugin code to a php file named after the hook, and just edit the hook call to an include() for that file (have a plugins folder the same as the includes folder) ?

Trigunflame 02-07-2006 05:25 PM

Paul, included I have a file called hook_files.php that list 1 file per line that tell the script which files are permitted to be parsed.

The hooks that have no plugincode associated with it, are commented out in "Accelerated Plugin Style Comment Blocks" for use later (Which Still Saves You an Empty Hook Function Call". If there is a valid hook that there is plugin code, it will insert the code in the correct location inside the files that use that hook.

When you enable/disable plugins, the files that are modified are reverted back to their natural state with their default vbulletin php code.

As for using includes, specifically "naming a file after each hook name", we would encounter 'the law of diminished returns'; as there are 8+ hooks in some files, includes() account for filesystem stat calls while on "Most" pages be faster than an eval() to a large amount of code; still be slower than running it directly from inside the script using it.

Note to Anyone Reading This: None of the above actually Works yet; we are still in testing stages.

PennylessZ28 02-07-2006 06:41 PM

Interesting cocept. I think I'll stick to manually doing my files.

Trigunflame 02-07-2006 07:31 PM

Quote:

Originally Posted by HR3rdGen
Interesting cocept. I think I'll stick to manually doing my files.

But if you are using lots of plugin code (which purpose is to keep people from directly modifying files) then for the average person; this would provide that solution without them having to manually edit code.

This is one of many modifications I plan to release involving the runtime of Vbulletin; with suggestions from Scott and a couple other people; there are many more places inside vbulletin that can be optimized.

Brad 02-07-2006 07:47 PM

I'll be keeping an eye on this one. Good to see you coding again. :)

Trigunflame 02-09-2006 02:12 AM

Update Everyone:

# First Working Release. Not all features are fully developed, but it does perform the primary objective.

# Automatic Re-Compiling of Plugins into Files will be presented in the next release; currently if you import, add, or update any plugin/product. Please click "Rebuild All Plugins" to refresh your files with up2date code.

----------------

In Short, this is a Functional Release; the tweaking of various parts of vbulletin to remove excess queries, and automatic recompiling on plugin add,edit,import will be presented in the next release.

I urge everyone to try this hack out and send feedback regarding any problems that you are having (If you have any).

Note: Using the built in Enable/Disable link, you can turn off the system at any point in time you wish incase a problem occurs; upon disabling it will convert all Compiled Code back into Vbulletins default Plugin Hook System and vice versa.

Thankyou.

Paul M 02-09-2006 02:48 AM

How will [vbulletin] upgrades be handled ?

Edit: A couple of points.

1. Please make it a product, and install the phrases this way.

2. Make a custom cpnav file to cut out the editing of the vbulletin one.

Trigunflame 02-09-2006 03:02 AM

Quote:

Originally Posted by Paul M
How will [vbulletin] upgrades be handled ?


Edit: A couple of points.

1. Please make it a product, and install the phrases this way.

2. Make a custom cpnav file to cut out the editing of the vbulletin one.

Update; (visited Vbulletin.com for help on those, im so used to 3.0.x >.> glad I know about these now thx paul.

As for upgrades, all that needs to be done is running "Rebuild Hook Cache", "Rebuild All Plugins".

Trigunflame 02-09-2006 03:43 AM

Ok updated the Install.txt
Created product installer: product-plugin_accelerator.xml
Created navigation addon: cpnav_plugin_accelerator.xml

ps. thanks paul for mentioning, I hadnt experimented with the product system yet. (havnt been around vb in like 6 months, lol)

Trigunflame 02-09-2006 08:10 PM

I think i have scared all of the testers off, it works people; atleast give it a try. Lol.

Paul M 02-09-2006 09:07 PM

Quote:

Originally Posted by Trigunflame
I think i have scared all of the testers off, it works people; atleast give it a try. Lol.

I don't really have time until at least the weekend.

Corriewf 02-09-2006 09:41 PM

WOW! This really made everything faster. GREAT MOD!!!! THANKS!

Trigunflame 02-09-2006 10:58 PM

Huge Update

- Critical bug involving active status to not be set has been resolved. Those who had problems with activating the system should now have no problems.

- Added many phrases to the system involving error messages and status messages

+ Note:

Please go through the install.txt file once more, changes were made to plugin.php which should be edited to take care of using the new phrases.

To upgrade:
Uninstall Product Vbulletin Plugin Accelerator, re-install it through the update file and move all the new files into the their appropriate places via the install.txt file.

vbreal 02-09-2006 11:56 PM

this sounds great, i need to watch this thread
i don't know enough about vbulletin to fix it if something goes wrong ha. i just started a site don't want to loose folks from down time ha

Trigunflame 02-10-2006 12:02 AM

Quote:

Originally Posted by Real Talk
this sounds great, i need to watch this thread
i don't know enough about vbulletin to fix it if something goes wrong ha. i just started a site don't want to loose folks from down time ha

Eh ive spent close to about 10+ hrs of bug-fixing regex problems it shouldnt hurt your files, but always make backups before you ever attempt to modify anything.

Trigunflame 02-10-2006 12:06 AM

If you get any parse errors, just re-run "Rebuild Hook Cache" and "Rebuild All Plugins" and it should clear any problems.

eNforce 02-10-2006 06:20 AM

Ok about my shoutbox problem, it now appears to only display it when I set the shout box to "below navigation bar" and Rebuild All Plugins. Won't work when it's set to "Below Forums"

Strange

Trigunflame 02-10-2006 06:36 AM

Quote:

Originally Posted by eNforce
Ok about my shoutbox problem, it now appears to only display it when I set the shout box to "below navigation bar" and Rebuild All Plugins. Won't work when it's set to "Below Forums"

Strange

Can you check your index.php to verify that the system is replacing the hook locations with the needed php code, you should see my comment blocks surrounding the php code ie.

//[p:forumhome_start]
$testing = 'woot';
//[/p:forumhome_start]

Should be 3 or 4 different comment block hooks throughout index.php

ps. if possible, change the filename to index.txt and upload it as an attachment.

eNforce 02-10-2006 06:39 AM

oooh about that, I have VBA CMPS installed and it's the index.php, the original VB index.php is renamed to forum.php. Is this causing the problems?

If so, any way to get around it?

(i don't see any comment blocks in the VBA CMPS index.php)

Trigunflame 02-10-2006 06:48 AM

Quote:

Originally Posted by eNforce
oooh about that, I have VBA CMPS installed and it's the index.php, the original VB index.php is renamed to forum.php. Is this causing the problems?

If so, any way to get around it?

(i don't see any comment blocks in the VBA CMPS index.php)

Try adding the forum.php to the includes/hook_files.php on its own line.

You have to remember, hook_files.php contains the locations to all of the files the Accelerator scans for hook locations; without that it doesnt know what and where to replace any plugin code.

Update that hook_files.php with forum.php and the Rebuild Hook Cache, Rebuild All Plugins.

eNforce 02-10-2006 06:54 AM

Done that, doesn't seem to help

Though it is leaving your comment blocks in forum.php

Reef 02-10-2006 06:55 AM

This is a great concept Trigunflame, I would love to improve speed any way possible but this killed my board after running Rebuild Hooks + Plugins.

After running those I recieved this error on every page I tried loading

Code:

Parse error: parse error, unexpected ']' in /home/rplace/public_html/board/includes/functions.php on line 4353

I ended up having to replace the php files with backups since I couldn't reload the page to try uninstalling it.

Trigunflame 02-10-2006 06:58 AM

Quote:

Originally Posted by eNforce
Done that, doesn't seem to help

Though it is leaving your comment blocks in forum.php

Hmm.. im trying to think what could be causing it to not show up, are you getting any sort of javascript errors? Or weird HTML when you view the page source?


All times are GMT. The time now is 09:14 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01525 seconds
  • Memory Usage 1,842KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete