[PLUGIN] - WooCommerce - Add shell script
The WooCommerce-Payments-Plugin connect with multiple payment processors with a single API to improve payment conversions, reduce costs and ops. It supports multiple currencies, offers fraud protection, and provides an easy-to-use dashboard for managing transactions and tracking sales.
Getting started
- Get familiar with Php and Javascript.
- Check the README.md for project structure and setup instructions.
- To setup locally, follow the steps provided here
Description:
Create a plugin.sh script that automates the creation of a ZIP file of the plugin repository. The script should exclude unnecessary files (like .git directories) and name the output in the format woocommerce-plugin.zip.
Contribution Guidelines:
- Fork the repository and create a new branch for your work.
- Ensure the WebSDK follows best practices for API integration and field rendering.
- Write clean, well-documented code with clear commit messages.
- Add unit tests to ensure the dynamic field rendering works as expected.
- Make sure to follow our coding standards and contribution guidelines.
Helpful Resources:
- Link to WooCommerce-Plugin documentation: WooCommerce
Submission Process:
- Ask the maintainers for assignment of the issue, you can request for assignment by commenting on the issue itself.
- Once assigned, submit a pull request (PR).
- Maintainers will review and provide feedback, if any.
- Maintainers can unassign issues due to inactivity, read more here.
Refer here for Terms and conditions for the contest.
If you have any questions or need help getting started, feel free to ask in the comments!
I can help create the shell script plugin.sh for archiving the repo.
sample
#!/bin/bash
PLUGIN_DIR="hyperswitch"
ZIP_FILE="$PLUGIN_DIR/woocommerce-plugin.zip"
# files and directories to exclude
EXCLUDE_LIST=(
"$PLUGIN_DIR/.git/*"
"$PLUGIN_DIR/.github/*"
# "$PLUGIN_DIR/.env"
# "$PLUGIN_DIR/plugin.zip"
# "$PLUGIN_DIR/.DS_Store"
)
# removing existing zip file, if exists
if [ -f "$ZIP_FILE" ]; then
rm "$ZIP_FILE"
fi
EXCLUDE_PARAMS=()
for item in "${EXCLUDE_LIST[@]}"; do
EXCLUDE_PARAMS+=("-x" "$item")
done
zip -r "$ZIP_FILE" "$PLUGIN_DIR" "${EXCLUDE_PARAMS[@]}"
echo "zip file created: $ZIP_FILE"
Hi, I have been writing scripts for a long time. Assign this issue to me and I'll soon update with the exactl approach here.
Hey @sakksham7 can I work on this issue ? I already had created a script for this issue
can i work on issue as i have worked on script and php
hi @sakksham7 Plz assign this issue to me
Hey All, To maintain fairness here, I am assigning this issue to @chikkibum (first come first serve basis).
We have plenty of open issues for everyone to work on, please pick from here
Please let us know if you need any help.
Hey @gorakhnathy7
Here is my written script
This script creates a ZIP file with name woocommerce-plugin.zip as mentioned in the issue. Do you need me to exclude any more files or make any changes to the script or should I raise a pr?
Excluded .git directory and all its content and plugin.sh script
#!/bin/bash
#Enter your directory below where plugin is located or place the script in the plugin directory
PLUGIN_DIR="."
ZIP_FILE="$PLUGIN_DIR/woocommerce-plugin.zip"
EXCLUDE_LIST=(
"$PLUGIN_DIR/.git/*"
"$PLUGIN_DIR/.plugin.sh"
)
if [ -f "$ZIP_FILE" ]; then
echo "Regular ZIP file exists."
else
echo "ZIP file does not exist."
fi
EXCLUDE_PARAMS=()
for item in "${EXCLUDE_LIST[@]}"; do
EXCLUDE_PARAMS+=("-x" "$item")
done
zip -r "$ZIP_FILE" "$PLUGIN_DIR" "${EXCLUDE_PARAMS[@]}"
echo "zip file created: $ZIP_FILE"
I would like to work on this. Can you assign it to me?