Forum Replies Created
- AuthorPosts
-
abctest483Memberit will also come down to functionality versus performance.
Raw performance is gained using nginx, php-fpm, memcached, apc and a proper designed server.
Functionality like plesk and magento performance could be managed by taking the entire infrastructure in perspective when designing a magento performance cloud.
abctest483MemberScribd no longer require you to host your documents on their server. If you create an account with them so you get a publisher ID. It only takes a few lines of JavaScript code to load up PDF files stored on your own server.
For more details, see Developer Tools.
September 21, 2010 at 12:28 pm in reply to: How To Include CSS and jQuery in my WordPress plugin? #10003
abctest483MemberSee http://codex.wordpress.org/Function_Reference/wp_enqueue_script
Example
<?php function my_init_method() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'); } add_action('init', 'my_init_method'); ?>September 21, 2010 at 1:26 am in reply to: How To Include CSS and jQuery in my WordPress plugin? #10008
abctest483MemberFor styles
wp_register_style( 'namespace', 'http://locationofcss.com/mycss.css' );Then use:
wp_enqueue_style('namespace');wherever you want the css to load.Scripts are as above but the quicker way for loading jquery is just to use enqueue loaded in an init for the page you want it to load on:
wp_enqueue_script('jquery');Unless of course you want to use the google repository for jquery.
You can also conditionally load the jquery library that your script is dependent on:
wp_enqueue_script('namespaceformyscript', 'http://locationofscript.com/myscript.js', array('jquery'));Update Sept. 2017
I wrote this answer a while ago. I should clarify that the best place to enqueue your scripts and styles is within the
wp_enqueue_scriptshook. So for example:add_action('wp_enqueue_scripts', 'callback_for_setting_up_scripts'); function callback_for_setting_up_scripts() { wp_register_style( 'namespace', 'http://locationofcss.com/mycss.css' ); wp_enqueue_style( 'namespace' ); wp_enqueue_script( 'namespaceformyscript', 'http://locationofscript.com/myscript.js', array( 'jquery' ) ); }The
wp_enqueue_scriptsaction will set things up for the “frontend”. You can use theadmin_enqueue_scriptsaction for the backend (anywhere within wp-admin) and thelogin_enqueue_scriptsaction for the login page.
abctest483MemberI’m more involved in the managed server optimization in my company but I may have a few tips for you. First, you can look at the code more closely using the code tracing feature of Zend server. It will allow you to see where and when the things get dirty.
I totally share benlumley’s consideration regarding the cache. Most of the sites we host doesn’t even have the block caching enable. This cache has to be explicitly called and not “assumed”. So if you code hasn’t yet took part of this mechanism, it’s something you definitely want to try. If you have a EE version, you can get the Full page up in order to get the best of the beast.
A reverse proxy will also help a lot. It’ll cache the static ressources, significantly lowering the pressure on the php interpretation stack of your front servers.
Don’t forget to write the sessions & Magento cache to a RAM disk. This will also definitely get you to another level of performances.
There’s still a lot to be said here but I’m running out of time. You have to know that a good site, well coded in a 1.4.1 CE version, running on a 2×5650 Xeon + 16 GB RAM server and having a Rproxy on top can take up to 50 000 unique visitors a day with smooth pages to everybody.
abctest483MemberSwitching from Apache to LiteSpeed helped us a lot. In addition to: Editing MySQL’s settings, installing Fooman Speedster (module to compress/combine js and css files), and installing APC. Magento has also posted a white paper on how to get the best performance out of the enterprise edition, but it is equally applicable to the other versions: http://www.magentocommerce.com/whitepaper/
abctest483MemberI got the same error message when I misspelled the jQuery reference and instead of
type="text/javascript"I typed “…javascirpt”. 😉
abctest483MemberI would also add: make sure for the category under the Display Settings tab, the Display Mode is set to “Products Only” or “Static blocks and products”. If this is set to “Static block only”, the products will not display for the category.
abctest483MemberYou could create a Javascript snippet that saves the template dir in a variable, and use this later:
<script> var templateDir = "<?php bloginfo('template_directory') ?>"; </script>
abctest483MemberWhen I first installed I had pages that were taking 30 seconds to load. My server was not maxed out in ram or processor, so I didn’t know what to do. Looking at firebug’s net panel it was loading about 100 files per page, and each one took a long time to connect. After installing fooman speedster and the gzip in the htaccess loads times were down to 3 seconds, like they had been on other shopping carts on my server.
abctest483MemberMagento is very slow because the database design is not very good. The code is a mess and very hard to update and optimize. So all optimizations are done via cache instead of code.
On the other hand. It is a webshop with a lot of tools. So if you need a flexible webshop just buy a very powerfull server and you will be ok.
abctest483MemberThere are many reasons why your Magento shopping cart could be running slow but no excuses for there is a variety of ways to eleviate the problem and make it pretty darn fast. Enabling Gzip by modifying your htaccess file is a start. You can also install the fooman speedster extension. The type of server used also will determine the speed of your store. More tips and a better explanation here http://www.interactone.com/how-to-speed-up-magento/
abctest483MemberThe checklist for whether items are in stock follows. Some will seem stupid until the first time you spend an hour trying to figure this problem out:
- The products must be Visible in Catalog.
- The products must be Enabled.
- Product must have a stock Quantity.
- The product must be set to In Stock.
- If the product is set not to track stock, it still has to have a stock Quantity and be set to In Stock.
- The product must be assigned to the target Category.
- If using multi-website mode (or if you imported the products through Data Flow), the products must be assigned to the target Website.
- You must refresh your Cache / Indices, just to make sure.
abctest483MemberCheck your product stock management options, in the default config items out of stock are not being displayed.
abctest483Member$('*[data-customerID="22"]');You should be able to omit the
*, but if I recall correctly, depending on which jQuery version you’re using, this might give faulty results.Note that for compatibility with the Selectors API (
document.querySelector{,all}), the quotes around the attribute value (22) may not be omitted in this case.Also, if you work with data attributes a lot in your jQuery scripts, you might want to consider using the HTML5 custom data attributes plugin. This allows you to write even more readable code by using
.dataAttr('foo'), and results in a smaller file size after minification (compared to using.attr('data-foo')). - AuthorPosts