ansonphong / postworld

Wordpress Theme Development Framework
GNU General Public License v2.0
7 stars 0 forks source link

cache_all_rank_scores() - FATAL ERROR #67

Closed ansonphong closed 11 years ago

ansonphong commented 11 years ago

Hi Haidy, When I run cache_all_rank_scores() on just one post_type with a few number of posts, then it reports back. Though then I set in postworld_options.php > $pw_defaults["rank"]["post_types"] to more than one post type, or post types which have many posts, then this error occurs:

Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 256 bytes) in /Users/phong/Projects Clients/Reality Sandwich/_WEB/RSV2/WORDPRESS/wp-includes/post.php on line 1916

Also there is one more thing I found that, it isn't creating new rows in wp_postworld_post_meta, where rows do not yet exist. So each time running cache_rank_score() it needs to create a row in wp_postworld_post_meta if it doesn't exist.

hmikhail commented 11 years ago

Solved the problem of memory size and adding a record to post_meta table. I found this warning in calculate_rank_score(): Undefined variable: FREE_RANK_POINTS in C:\BitNami\wordpress-3.6.1-0\apps\wordpress\htdocs\wp-content\plugins\postworld\php\postworld_rank.php on line 84.

Also at some points this error occurs: Fatal error: Maximum execution time of 60 seconds exceeded. I found a solution for that part in a thread http://wordpress.org/support/topic/cant-use-maximum-execution-time-exceeded, the following parts should be changed.

1. Adapting the wp-config.php:
set_time_limit(60);

Important – If you are making changes in wp-config.php, then add this line above the “/* That’s all, stop editing! Happy blogging. */” comment.

2. Adapting the /.htaccess file of your WordPress installation
php_value max_execution_time 60

3. Adapting the php.ini file
max_execution_time = 60;

Have you faced this problem before? Should this be specified in the installation instructions of the plugin?

ansonphong commented 11 years ago

Very good question, I haven't faced this before with Wordpress although good we solved it. I can fill in the FREE_RANK_POINTS part. I'll have a look at it.

On 2013-11-03, at 1:18 AM, hmikhail notifications@github.com wrote:

Solved the problem of memory size and adding a record to post_meta table. I found this warning in calculate_rank_score(): Undefined variable: FREE_RANK_POINTS in C:\BitNami\wordpress-3.6.1-0\apps\wordpress\htdocs\wp-content\plugins\postworld\php\postworld_rank.php on line 84.

Also at some points this error occurs: Fatal error: Maximum execution time of 60 seconds exceeded. I found a solution for that part in a thread http://wordpress.org/support/topic/cant-use-maximum-execution-time-exceeded, the following parts should be changed.

  1. Adapting the wp-config.php: set_time_limit(60);

Important – If you are making changes in wp-config.php, then add this line above the “/* That’s all, stop editing! Happy blogging. */” comment.

  1. Adapting the /.htaccess file of your WordPress installation php_value max_execution_time 60
  2. Adapting the php.ini file max_execution_time = 60; Have you faced this problem before? Should this be specified in the installation instructions of the plugin?

— Reply to this email directly or view it on GitHub.