Your IP : 216.73.216.101


Current Path : /opt/sharedrads/__pycache__/
Upload File :
Current File : //opt/sharedrads/__pycache__/fixwpcron.cpython-313.pyc

�

iXMj���~�SrSSKrSSKrSSKrSSKrSSKrSSKrSSKJr Sr	Sr
SrSrSr
\S	:Xa\
"5 gg)
aywp-cron was a hacky Wordpress feature added to compensate for Windows's
lack of scheduling system. Certain plugins can trigger very poor behavior that
causes it to be run every time anything happens on the site. The end result is
dozens of thousands of redundant hits to wp-cron.php. This script disables the
wp-cron feature, and sets up a cronjob to run once every three hours�N)�	is_cpuserc���[R"[S9nURSS9nUR	SSS[
RRSS9 S	n[R"5nUS
:XaUR	SSUS
9 OUR	SSSUS9 UR5nUR(a�[
RRUR5(d#[R"URS35 URRS5SS:XdeURRS5SUl[%US5(dSUlUR&(aX4l[)UR5(d#[R"URS35 U$![ ["4a [R"S5 N�f=f)zParse commandline args)�descriptionT)�requiredz--pathz-p�PATHz�path to wordpress installation. If using this argument, we assume the customer has not modified the site to have wp-config.php in an alternate directory. Both wp-config.php and wp-cron.php should be present in the supplied directory)�metavar�type�helpz�Set this up for every WordPress installation that the user
        owns. Installations modified to have wp-config.php in an alternate folder
        for security are supported; wp-config.php and wp-cron.php files will
        be located separately
    �rootz--userz-u)r
z--allz-a�
store_true)�actionr
z does not exist�/��home�z-Incorrect path. Should be in a user's homedir�allFz is not a cPanel user)�argparse�ArgumentParser�__doc__�add_mutually_exclusive_group�add_argument�os�path�realpath�getpass�getuser�
parse_args�isdir�sys�exit�split�user�AssertionError�
IndexError�hasattrrr)�parser�group�all_help�current_user�argss     �/opt/sharedrads/fixwpcron.pyrrs���
�
$�
$��
9�F��/�/��/�>�E�	����$��
�W�W�
�
�,����H�
�?�?�$�L��v��
���8�T���9�
���7�D��H��M�����D��y�y��w�w�}�}�T�Y�Y�'�'��H�H��	�	�{�/�2�3�	F��9�9�?�?�3�'��*�f�4�4�4��	�	����,�Q�/�D�I��4��������x�x� �	��T�Y�Y������D�I�I�;�3�4�5��K���
�+�	F��H�H�D�E�	F�s�AF<�<&G%�$G%c��[USS9nUR5nSSS5 [W5HUup4SU;dM
X#S-S:Xa[SU5  gX#S-S:XaSX#S-'O[S	R	U5S
SS9  g O [USSS9nURU5 SSS5 g!,(df   N�=f!,(df   g=f)
z,Sticks the DISABLE_WP_CRON line in wp-configzutf-8)�encodingN�DB_USERrz#define('DISABLE_WP_CRON', 'true');
zFile already modified:�
zCNon-standard wp-config file at {}. Add this manually under DB_USER:z"define('DISABLE_WP_CRON', 'true');)�sep�w)�open�	readlines�	enumerate�print�format�
writelines)�filename�handle�linelist�index�lines     r+�turn_offr=<s���	
�h��	)�V��#�#�%��
*� ��*��������	�"�&L�L��.��9����	�"�d�*�&L����#��%�%+�V�H�%5�8��	���+� 
�h��g�	.�&����(�#�
/�	.�%
*�	)��$
/�	.�s�B.�B?�.
B<�?
C
c���U(a[R"5nO[R"US9nSUS3n[URU5Vs/sHoUR	5(dMUPM sn5S:�a
[SU5 gUR
US9nURRS5 URR[R"SS	55 UR5 gs snf)
z$Setup php -q wp-cron.php system cron)r"zcd z; php -q wp-cron.phprzCron already enabled:N)�command��;)�crontab�CronTab�len�find_command�
is_enabledr5�new�hour�every�minute�on�random�randint�write)r"r�not_root�ctab�cmd�x�jobs       r+�
setup_cronrTTs������� �����D�)����v�)�
*�C�
�t�(�(��-�@�-�!����A�-�@�A�A�E�
�%�s�+��
�(�(�3�(�
�C��H�H�N�N�1���J�J�M�M�&�.�.��B�'�(��J�J�L��
As�C5�,C5c�(�/n/n[R"[RRSU55HTup4nSU;a/UR	[RRUS55 SU;dMCUR	U5 MV X!4$)z8Find wp-config.php files and dirs containing wp-cron.phpz/home�
wp-config.phpzwp-cron.php)r�walkr�join�append)r"�crondirs�configsr�_�	filenamess      r+�
find_filesr^dsv���H��G� �g�g�b�g�g�l�l�7�D�&A�B�����i�'��N�N�2�7�7�<�<��o�>�?��I�%��O�O�D�!�	C�
���c�b�[5nUR(a9[RRURS5/nUR/nO[	UR
5up[
U5S:�a [S5 [USS06 [5 [
U5S:�a [S5 [USS06 [5 UHn[U5 M UH#n[UR
X0R5 M% [S5 g	![a [SU5 Maf=f)
zMain program logicrVrzwp-config.php file(s):r0r/z-dir(s) to setup system crons for wp-cron.php:zError reading/writing tozdone.N)rrrrXr^r"rDr5r=�OSErrorrTr)r*r[rZrs    r+�mainrbps����<�D��y�y��7�7�<�<��	�	�?�;�<���I�I�;��&�t�y�y�1���
�7�|�a��
�&�'�
�w�!�D�!�
��
�8�}�q��
�=�>�
�x�"�T�"�
����	4��T�N��
���4�9�9�d�H�H�-��	�'�N��	�	4��,�d�3�	4�s�D�D.�-D.�__main__)rrrrrLrrB�radsrrr=rTr^rb�__name__�r_r+�<module>rgsP��H��	��
����'�T$�0
� 	��4�z���F�r_